I've discovered that when I upload an image that is not larger than the size specified for derivative, Image doesn't create the derivative.

Specifically, I have specified that Preview derivatives are to be 168 pixels wide. If I upload an image that is less than 169 pixels wide, the Preview derivative isn't created.

This is a problem because my site uses the derivatives as standard-size "original" images. For example, if a story in the right-hand column of the layout incorporates an image it displays the Preview derivative, so that every image in that column is 168 pixels wide. If the user uploads an image that is less than 169 pixels wide, the derivative doesn't exist and the story is accompanied by alt text instead of the picture.

I chose the 168 pixel dimension because it is the standard width of this type of picture on my client's old website. My client has a large number of pictures on the old website that are already 168 pixels wide, and that are supposed to appear on the new site. As things now stand, my client will have to make every one of them bigger so that Drupal can make them smaller again. Understandably, this does not appeal to him!

I gather that the designers of the Image module expect this requirement to be met by resizing the original image. That won't work because images used in different contexts must be different sizes. For example, images used in the middle column of the layout must be 80 pixels high. I accomplish this by using Thumbnail derivatives in stories that appear in the middle column, and specifying that they are to be 80 pixels high.

The only solution I can think of is to test for the existence of the derivative -- in every location where I use one -- and use the original image if it isn't available. Is there a better way to deal with this?

Comments

sun’s picture

Status: Active » Closed (works as designed)

This is the intended behavior, because you would have needless derivative files otherwise.

Sorry, unfortunately this request is way too specific. Please have a look at the issue queue - Image maintainers are buried already. You might want to try to get further support at http://drupal.org/support. Additionally, the answer to your question might be covered in the handbooks at http://drupal.org/handbook/modules/image already.
If you were able to solve this issue on your own in the meantime, you might want to add the involved steps to this closed issue, so other users searching for a similar solution might find it.