Support for Drupal 7 is ending on 5 January 2025—it’s time to migrate to Drupal 10! Learn about the many benefits of Drupal 10 and find migration tools in our resource center.
I would like to add a thumbnail format that scales any image to fit a specified width.
So, instead of typing "120x120" I would type "120x0".
And this is how it would resize images:
- 240x100 would become 120x50
- 60x60 would become 120x120
- 90x30 would become 120x40
you get the idea.
The same does long exist in imagecache, but not (yet) in imce.
Comments
Comment #1
donquixote CreditAttribution: donquixote commentedComment #2
donquixote CreditAttribution: donquixote commentedAnd here we go, the solution. No time to produce a patch atm.
In inc/imce.page.inc, function imce_resize_image()
EDIT: Changed the code a bit.
Comment #3
donquixote CreditAttribution: donquixote commentedI would say, just commit the above code, and later think about better documentation on the configuration form.
Comment #4
donquixote CreditAttribution: donquixote commentedThe current behavior for "120x0" or "0x120" or "120x" results in an ajax error. So, I think it is a good idea to do something meaningful instead.
Comment #5
Anonymous (not verified) CreditAttribution: Anonymous commentedPreservation of aspect ratio for thumbnails would be a useful addition to this project.
Comment #6
ufku CreditAttribution: ufku commentedPlease check out "Default method for creating thumbnails" under common settings at admin/settings/imce. (admin/config/media/imce in D7)
Comment #7
durum CreditAttribution: durum commentedsub
Comment #8
joelrotelli CreditAttribution: joelrotelli commentedIs the code above has been ported to the project ? Cause it will be very usefull !
Comment #9
Perignon CreditAttribution: Perignon commentedWant to bump this issue up because I think this would be really nice to have. Going to change to the 1.x-dev branch to get
Comment #10
Perignon CreditAttribution: Perignon commentedActually i think this has been implemented via JS in the UI. I just tried doing some resizing to find that IMCE auto populated the other dimension with a proportional number.
Comment #11
KoshaK CreditAttribution: KoshaK commentedThe same question was raised already for Version 6 few years ago. Very strange that this future still not implemented. Will wait for this future as I'm really need it.
Comment #12
thallesThis yet is need?