By timezero on
Dear fellow Drupal user,
I was wondering if it's possible to upload and store an image and also create a user-cropped thumbnail for it on the same page?
I've created a content type with one File -> Image and one File -> Image with cropping (using http://drupal.org/project/imagefield_crop)
Problem is that the user will have to upload the same image twice, once to store the full image and once more to create and store the cropped thumbnail for it - this might be a bit confusing for her.
Is it somehow possible for Imagefield Crop to automatically load the image uploaded in the File -> Image field, or similar?
Thanks for taking your time to read!
Comments
_
Don't use the module, but it says on the project page that the original is saved.
Thanks for your reply! It
Thanks for your reply!
It says on the project page that "the image is cropped and the result is saved instead of the original image." but you are right, it also says "Original image is saved for recropping." However the original image is not saved in the Node so it does not help much.
_
See #240849: Add an option to display the original image for some ideas.
_
Also, you can theme the field and/or the node to just display the original (which has the original filename) along with the imagefield cropped one any way you like.
I think you can use
I think you can use ImageCache module. Just create a preset image, called as "cropped image" then your Original Image will have a cached image which already cropped. This mean, your user need no to upload a cropped one because ImageCache will automatically create it.
ImageCache supports scale, crop and scale+crop image.
bingo
bingo
http://ItsAboutTyme.com
_
This only works if you can preset the desired cropping-- for interactive cropping, which is what imagefield_crop does, this doesn't work.
2 presets?
Yes but what if he set up 2 presets for the image? Is it possible to enable imagefield_crop for one and do nothing with the other? That way both images would be associated with the node and he could do whatever Views magic he wanted.
A list of some of the Drupal sites I have designed and/or developed can be viewed at motioncity.com
_
Not sure how or if imagefield_crop integrates with imagecache, but from what I understand the poster wants to display both images--cropped and uncropped. Even with imagecache integration, one imagefield can only display once (unless themed to display otherwise).
Views
I guess I assume he would use Views.
A list of some of the Drupal sites I have designed and/or developed can be viewed at motioncity.com
_
Yeah you can do this with views no problem, but I read the op as asking how to do this on the node display itself.
Image crop does not integrate
Image crop does not integrate imagecache, unfortunately.
But, fortunately, there is this patch http://drupal.org/node/426892#comment-2973000 that integrates image crop with imagecache (and CCK).
After applying the patch, I setup an imagacache preset called "Original-image" and simply didn't add any settings (crop, scale etc) to it. Then I edited my Content type's "Display fields" and set the Image field to display the "Original-image (uncropped)"
Then I'd have Views call the cropped image (called Image) where desired.
Epsacrop is working
Epsacrop is working wonderfully, it lets you see the original image (scaled down to fit in the imagefield form), then you drag a rectangle to show what area to use in the thumbnail (actually, any of the imagecache settings which is configured to use epsacrop). This works with the dimensions as presented from the imagecache preset, as is what you want.
Not only does it work wonderfully, it looks beautiful on the form and presents the options in what I believe is an easily discoverable way for the user.
Paul K Egell-Johnsen
As for loading an existing
As for loading an existing image file from the filesystem there is a module for this: http://drupal.org/project/filefield_sources, but in your case the original will have been cropped (if doing that first) and there will be no file with the full image.
I suggest http://drupal.org/project/epsacrop as it plays nicely with imagecache, letting the user upload the file only once and then add cropping just after uploading the image. You can also use filefield_sources together with epsacrop, my preferred method.
Paul K Egell-Johnsen
I add a custom field for
I add a custom field for thumbnail image (thru CCK). And am using imagecache and imagecrop.
http://ItsAboutTyme.com