I want to set a *maximum* size. If it's larger, then resize... and if it's smaller, don't.
I've changed the module to these settings in an attempt to do just this:
Default max image resolution -- 800x600
List of valid resolutions -- (empty)
But this will still take a small, say 200x100, image and enlarge it to 640x480.
| Comment | File | Size | Author |
|---|---|---|---|
| #4 | image.module.original_resolution.patch | 2.97 KB | robertdouglass |
Comments
Comment #1
teradome commentedP.S. image.module *does* say this under the List of valid resolutions field: "This is a list of resolutions that the image can be displayed at as well as its original size" -- but currently this seems to only mean original if it is larger than 640x480.
Comment #2
(not verified) commentedHere's a nice fix for this:
administer -> settings -> image
add "original" to the "List of valid resolutions" -- e.g. "original,640x480,800x600,1024x768,1600x1200"
submit
Now "original" will be listed in the "Default image display resolution" -- select it.
submit
why "original" is not listed by default is a mystery to me.
Comment #3
ben@civicspacelabs.com commentedwhoops that's me with the fix
Comment #4
robertdouglass commentedI haven't really tested the validity of ben's claim, but here is a patch that includes 'original' as one of the default resolutions.
Comment #5
robertdouglass commentedHmmm, the problem with this approach (and the patch) is that original and original image then show up (redundantly) in the links for the image.
Comment #6
dandaka commentedTo delete duplicated link "original" and leave only "original size", replace this:
line 220
if ($node->width > $max_dim[0] || $node->height > $max_dim[1]) {
with this:
if ($node->width > $max_dim[0] || $node->height > $max_dim[1] && $v != "original") {
Comment #7
Zed Pobre commentedDoing this seems to leave me with one of two negative conditions: I end up with either all images left at their original size by default (good for small images, bad for large), or all images scaled to a particular resolution by default (good for large images, bad for small). Can anyone explain how to have any images larger than, say, 800x600 resized, and anything smaller left at the original size? The Max Resolution field doesn't seem to do anything.
Comment #8
tulula commentedAny other solutions?
I've tried both solutions on this post and neither control when you open up the node to view it - neither keep it at the original size.
Lisa
Comment #9
tulula commentedExcited - this submission worked perfectly for me!
http://drupal.org/node/14000
Lisa
Comment #10
chx commentedno longer applies
Comment #11
chx commentedoh, sorry 4.5 shall be left alone.
Comment #12
sas789 commentedLisa, I checked out the code you recommended, but being a newbie I can't figure out how to install the patch. Could you provide some direction? Thanks much.
Comment #13
sas789 commentedNever mind, figured out what all those plusses and minusses mean... :-)
Comment #14
walkah commentedthis only applies to 4.5
Comment #15
basicmagic.net commentedhey- i love image.module for 4.5.2...
but just wondering if anyone has this working-
what zed was talking about here:
http://drupal.org/node/13867#comment-22136
"Doing this seems to leave me with one of two negative conditions: I end up with either all images left at their original size by default (good for small images, bad for large), or all images scaled to a particular resolution by default (good for large images, bad for small). Can anyone explain how to have any images larger than, say, 800x600 resized, and anything smaller left at the original size?"
1- large images shown at smaller size (max res, say = 800x600)
**works fine**
2- smaller images shown at original size (less than or equal to max res, say =800x600
**how do i make this work?
please advise- this would be the killer final fix to image.module for 4.5.2-
thanks-
vincent
Comment #16
walkah commentedplease upgrade to 4.6