Add option to stop up sizing during crops,

globetrotter - February 1, 2009 - 13:11
Project:ImageCache
Version:6.x-2.x-dev
Component:imagecache_image module
Category:bug report
Priority:normal
Assigned:Unassigned
Status:active
Description

The crop implementation crops an image regardless if there is really something to crop. I think it would make more sense to crop only if the image is actually bigger than the cropping area.

If I want to crop all images to a max height of 100px I don't want images with 50px height to be enlarged to 100px by inserting a transparent part. That's how it works today and it doesn't really make sense like that.

#1

Tony Sharpe - March 25, 2009 - 12:28
Version:6.x-2.0-beta5» 6.x-2.x-dev

I have the same issue. I have the occasional image that is less than my desired final image size and in those cases I just want that image to be unchanged. Using 'scale and crop' a small image gets upsized. Using 'depricated scale (outside)' then 'crop' puts a black background around it to bring it up to the crop size. This is no good as I then process it further with imagecache_actions. Is there a way to only crop if required? Tested with both beta 8 and latest dev.

#2

drewish - May 3, 2009 - 20:51
Title:croping adds transparent part to small images» Add option to stop up sizing during crops,
Category:bug report» feature request

well i think there's clearly a use for it. if you want to get a larger canvas you'd use the crop function to do so. that said adding an "allow upcropping" option (similar to the allow upscaling option) would be helpful for cases like yours where you don't want that behavior.

#3

ambo - June 9, 2009 - 05:39
Category:feature request» bug report

I change that back to bug report because from the editorial point of view it is a bug that pictures that don't have enough sizes to be cropped are cropped.
The behaviour that is expected here is that images with smaller size are not upscaled. I don''t think there is at least one case that anybody wants to have upscaling...

thanks a lot

#4

jddh - November 16, 2009 - 09:09

Anyone find a solution to this?

#5

trupal218 - November 21, 2009 - 10:29

subscribing

#6

jddh - November 25, 2009 - 19:24

I resolved this by hacking the module. Not a clean fix, as I haven't added an "upscale" toggle in admin, but I disabled all "upcrops".

 
 

Drupal is a registered trademark of Dries Buytaert.