Closed (fixed)
Project:
Node Images
Component:
Code
Priority:
Normal
Category:
Bug report
Assigned:
Unassigned
Reporter:
Created:
17 Feb 2007 at 12:41 UTC
Updated:
1 Jan 2008 at 23:45 UTC
Jump to comment: Most recent file
When you use an image that is smaller or equal to the thumbnail size in the settings page the thumbnail isn't generated, yet the module tries to reference it with the img tags.
When the image is smaller you can either reference the original image or create a thumbnail by copying the original image.
| Comment | File | Size | Author |
|---|---|---|---|
| #7 | node_images_7.patch | 9.61 KB | stefano73 |
Comments
Comment #1
oriol_e9gSame problem!
When the image is smaller or equal than the thumbnails Resolution the thumbnail is no generated!
Comment #2
oriol_e9gI have fix this problem adding this patch: http://drupal.org/node/147538
Comment #3
nevets commentedAnother appoach to handling images smaller than the thumbnail size is to add logic in _node_images_create_thumbnail() that makes sure the thumbnail was generated and if not uses the original image as the thumbnail. Here is my modified version of the function (sorry no patch)
Comment #4
hgmichna commentedThanks for the replacement function, but it may be safer to copy the picture while appending _tn to the filename, for the simple reason that that will be compatible with any future version of the module.
Comment #5
Papayoung commentedThis fix creates a properly-named copy to use as a thumbnail. I don't have an easy way to roll patches, but here are the specific code changes (in node_images.module, v1.7.4.2, 5.x-1.x-dev):
Line 822:
is replaced by:
Note: I don't like creating unnecessary copies of files, even though these are going to be small ones, but in this case I think it's better to be forward-compatible than hyper-effiecent with disk space.
Comment #6
hgmichna commentedGreat, thanks! Have patched the module manually with your code and will see how it goes. If any problem crops up, I will report here. Silence indicates happiness.
Can this be rolled into a future module version?
Hans-Georg
Comment #7
stefano73 commentedHi guys, can you try the attached patch? It contains several fixes on file paths and thumbnail creation.
The patch is against HEAD.
Thanks.
Comment #8
hgmichna commentedWhere can an ordinary user, who is not a developer, download HEAD?
Hans-Georg
Comment #9
hgmichna commentedWhere can an ordinary user, who is not a developer, download HEAD?
Another question: Does this patch still create a *_tn.* file when the original image is small? If not, that would cause problems, because some other systems expect these _tn files.
Hans-Georg
Comment #10
stefano73 commentedYou can find the HEAD version here
The patched module still creates the _tn files when image size is small.
Comment #11
marcoBauli commentedhey all,
worked fine here out of the box with latest 5.x-1.x-dev. Was the patch integrated? cheers
Comment #12
stefano73 commentedYes, it's already in the CVS. You can find new updates here: http://drupal.org/node/118702#comment-675694