I am sure something like this is in the works and read it can be done with imagecache. I think the benefit of the following would be taking out the need for another module, and a cleaner UI.
Once you create an imagefield inside of a content type, there could be a checkbox for "create thumbnail," and a max height/width scale/resize textbox. Then you could have a variable like $field_image[0]['thumbpath'] to use when theming.
Does this sound useful? Thanks.
Comments
Comment #1
dopry commentedThis is available through imagecache and views. and using the content_format function in your themes.
Comment #2
zach harkey commentedReopening this issue because I think the posted solution doesn't address all scenarios.
I completely understand delegating most image manipulation to imagecache and the theme layer. However, I really think imagefield needs to provide a thumbnail, for the administrative form previews. As far as I can tell, the administrative preview thumbnails are actually the full original images scaled down to fit 150px wide. This may work in many cases where only a few small images are being uploaded. In situations where several hi-resolution images (e.g. professional photography at 2400x2400 ) are being uploaded, the whole workflow becomes very unstable if not completely unusable. At the very least, the previews flake out.
A default administrative thumbnail derivitive would really help mitigate this situation, or should I be overriding even the the admin form functions in my theme so the upload previews use imagecache thumbnails?
Comment #3
zach harkey commentedComment #4
dopry commentedYou're welcome to submit a patch. I'd be happy to commit it, but It conflicts with some of my current plans of moving this kind of stuff to a lower level, so I won't focus my development time on this feature.
Comment #5
scroogie commentedWhat you could do is build in a check for imagecache, and if existant, use imagecache for scaling down the picture. I think most of the people will use imagefield with imagecache anyway, and lets not build in more self-coded image manipulation operations, we imho already have that spreaded too much in drupal...
Comment #6
zach harkey commentedOk, so I created the following override in my theme's template.php:
And it does what I want on subsequent viewings of the form, but not on the initial upload where I get a broken image icon. If I submit, then view, then edit the form again, the resized imagecache thumbnail displays properly. Am I close here? or am I in left field?
Comment #7
whereisian commentedHas this idea been revisited anywhere? I'd love to see this implemented for the same reason. Thanks for the snippet Zach Harkey, I'll be trying that out.
Comment #8
dopry commentedThe Snippet Zach Harkey has written should work with imagefield 2.x... I just need it as a patch and I need it to check if imagecache is installed when deciding to display the preview...
.darrel.
Comment #9
quicksketchWe have had thumbnails in theh 3.x version for quite a while now. Let's open a new issue for any enhancements to the current approach.
Comment #10
robomalo commentedI am closing the issue. If anyone thinks it should be open, feel free to make it active again. Zach: thanks for the work!