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.
If I'm right, ImageField creates automatically thumb files of uploaded images and places them in the same folder as the full size image. They are named UPLOADEDIMAGE.jpg.thumb.jpg
Is it possible to create them in a subfolder or different folder in general? Would be cool, if you could provide a path setting for this thumb images and not only for the uploaded images.
Comment | File | Size | Author |
---|---|---|---|
#7 | imagefield_new_thumbnails.patch | 5.45 KB | quicksketch |
Comments
Comment #1
no2e CreditAttribution: no2e commented*bump*
No idea/tip/help? I want to publish the website, and then many, many images will come in. Would love to fix it before that.
Comment #2
no2e CreditAttribution: no2e commentedNo way?
Comment #3
thePanz CreditAttribution: thePanz commentedIf you can code: look for
imagefield_file_admin_thumb_path()
function in imagefield_file.inc and try to manage it with a config in the Admin section. Shouldn't be too hard!Regards
Comment #4
notabenem CreditAttribution: notabenem commentedIn addition, these files are completely useless if someone uses ImageCache.
It would be great, if enabling ImageCache would automatically disable the generation of these .thumb. files.
Comment #5
Zach Harkey CreditAttribution: Zach Harkey commentedI understand the need for a default thumbnail derivative to display in the administrative form. The old way of optically scaling down the original image caused all kinds of problems e.g. in nodes with several very large original images.
However, I completely agree with the previous posters about the non-configurable hardcoded ".thumb.jpg" style thumbs in the same directory. One of my main reasons for dumping the Image module was because of its insistence on automatically creating a minimum of three images for each original and insisted on keeping them in the same directory.
Imagecache provides such an elegant way around that kind of mess. We should use Imagecache to create these thumbnails or not do it all.
- If you don't have Imagecache installed, your thumbnail is simply the original file, optically scaled to look like a thumbnail. This should be perfectly acceptable for the beginner level user who doesn't have Imagecache installed.
- If you do have Imagecache installed, you can specify a derivative to use in the field settings form. Or Imagefield could just automatically generate a derivative for this use.
This would also mitigate the problem of all the missing ".thumb.jpg"-style thumbnails after attempting to upgrade from Imagefield 5.x. As it stands now, these image paths are completely broken in the admin form.
Comment #6
drewish CreditAttribution: drewish commentedThere's no way to configure it. I'm not that interested in adding the feature personally.
Comment #7
quicksketchThis does irritate me quite a bit also. I've written the attached patch which moves all thumbnails to [files]/imagefield_thumbs/[original path], similar to ImageCache's approach.
This patch also changes the way things work by generating images when they are shown in the preview, rather than generating images when files are uploaded. Generating on upload had the odd side-effect of generating images even when they weren't necessary (like when they're uploaded through a FileField widget).
As a small bonus and keeping #305621: Imagefield configurable upload thumbnail size and #402014: Use imagecache for thumbnails in mind, I made a variable for the imagefield preview size, though this is not configurable through the UI. I think it's nice to give advanced admins the option to change this through settings.php or variable editing, but most site administrators will use the ImageCache option once that becomes available.
Comment #8
quicksketchIn the name of getting out a better version of ImageField, I've committed the above patch. I tested both public and private files and the upgrade path a few times over, everything seems to be working swimmingly. Please post any problems with the new approach.