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]);
+++ }
| Comment | File | Size | Author |
|---|---|---|---|
| #5 | imagecache.patch | 909 bytes | volkiz |
Comments
Comment #1
dopry commentedI'll put this in 2.x.
Comment #2
dopry commentedcan you provided a unified diff?
Comment #3
volkiz commentedthis is a addition not a patch all
and im not using any diff tool so pls do it yourself.sorry
Comment #4
dopry commented@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.
Comment #5
volkiz commentedok here is a patch.
thanks dopry
Comment #6
dopry commentedYo that stuff is committed to 1.x... :)
Comment #7
dopry commentedoh yeah... fixed. :)
Comment #8
Anonymous (not verified) commentedAutomatically closed -- issue fixed for two weeks with no activity.