with this patch images will resize by original file aspect ratio
in imagecache preset screen u need to set one variable for image dimension
if u set height 0 or leave blank then height will set by width auto
if u set width 0 or leave blank then width will set by height auto
code implemented by huzursuz ipnesi

#172 foreach ($actions as $action) {
#173 $size = getimagesize($tmpdestination);
+++ if (($action['data']['height'] == 0) or is_null($action['data']['height'])) {
+++ $action['data']['height'] = round($size[1] * ($action['data']['width'] / $size[0]));
+++ }
+++ if (($action['data']['width'] == 0) or is_null($action['data']['width'])) {
+++ $action['data']['width'] = $size[0] * ($action['data']['height'] / $size[1]);
+++ }

CommentFileSizeAuthor
#5 imagecache.patch909 bytesvolkiz

Comments

dopry’s picture

Version: 5.x-1.x-dev » 6.x-2.x-dev
Category: bug » feature
Priority: Normal » Critical

I'll put this in 2.x.

dopry’s picture

Status: Active » Needs work

can you provided a unified diff?

volkiz’s picture

this is a addition not a patch all
and im not using any diff tool so pls do it yourself.sorry

dopry’s picture

Status: Needs work » Closed (won't fix)

@volkiz,
patches can be used to make additions to files. That is what we have them for. No I'm not creating a diff myself for you. I've put in many hours on this code, If you want your additions in the mainline of imagecache or recognition for it, you will make it patch or It won't get added that simple.

I'm sorry I don't work for you, and you're out of line telling me what to do. That is something you say to paid employees not peers in an open source community.

see http://drupal.org/patch/create for directions to create a patch. If you change your mind I will still consider the patch.

volkiz’s picture

Version: 6.x-2.x-dev » 5.x-1.3
Status: Closed (won't fix) » Needs review
StatusFileSize
new909 bytes

ok here is a patch.
thanks dopry

dopry’s picture

Yo that stuff is committed to 1.x... :)

dopry’s picture

Status: Needs review » Fixed

oh yeah... fixed. :)

Anonymous’s picture

Status: Fixed » Closed (fixed)

Automatically closed -- issue fixed for two weeks with no activity.