This is a great module. Can't believe it has been around since D5 and i never knew about it.

The project states that the original image is stored (so that it can be recropped later); which is cool; but is there anyway to use the original image (possibly in a view, with imagecache)?

Comments

stopshinal’s picture

I am also very interested in how to access this original image. I'd like to apply the 'thumbnail' to the original image for a views display.

charlie-s’s picture

The original file is stored in the field, i.e. something like $node->field_cropped_image[LANGUAGE_NONE][0]['uri'] gives you the URI to the original image. Perhaps the field formatter could allow for picking the image style in a View the same way a normal Image field does -- you could pick any of your styles or "original image".

rmwolinski’s picture

I set in Views original image but I steel have the same crop image. Any ideas?

sondes’s picture

Category: support » feature

I agree. This would be a useful feature if it's not already in place!

sondes’s picture

Alright. I couldn't let this one sit without poking around some...

This isn't exactly an answer to the question but it may help. To access the original, uncropped image in Views, create a relationship based on File. Then add the File: Name field. This will show the original filename of the image. This can be used to create a link to the original image, or display it in a lightbox overlay, etc...

mp’s picture

is there a way to link the cropped thumbnail in the full node view to the original one?

greets

alphex’s picture

This would be an awesome addition to the V2 version of this module, if you could access the original uncropped file.

Anonymous’s picture

It appears as though the original file gets saved, but just appends "_0" onto the end of the file name. So if you upload an image "123.jpg" the original gets saved as "123_0.jpg". This is how I was able to access the original file.

joetsuihk’s picture

There are suggestions about how the original image should be accessed. May refer to https://drupal.org/node/1265824#comment-5038116

Tezcatlipoca’s picture

Posted by sondes on July 26, 2012 at 9:54pm
Alright. I couldn't let this one sit without poking around some...

This isn't exactly an answer to the question but it may help. To access the original, uncropped image in Views, create a relationship based on File. Then add the File: Name field. This will show the original filename of the image. This can be used to create a link to the original image, or display it in a lightbox overlay, etc...

This sounds great; thanks for sharing sondes. However, I'm still getting the altered image file name when I try it. Maybe I'm setting the relationship up wrong?

Chim’s picture

Great module, love the way it works out of the box.

Here is one way to get the original uncropped image, this is similar to the way the module does it for the admin crop widget.

// how you get the fid depends on where you need it, but it's available on the entity field.
// this returns a file object.
$big_image = _imagefield_crop_file_to_crop($fid);

// you'll want the actual url as well (probably)...
$big_image_url = file_create_url($big_image->uri);

Hope this helps :)

unfeasible’s picture

Issue summary: View changes

Was there any update on linking the full size image for a lightbox style effect, or to get the original image to size with imagecache?

igorgoncalves’s picture

#11 works perfect to me!

i was getting crazy!

thanks chim

stefanos.petrakis’s picture

Status: Active » Needs review
Related issues: +#1265824: Source of cropped image is renamed
StatusFileSize
new2.53 KB

Here is a patch for the 7.x-2.x branch that provides a formatter that gives access to the original/uncropped image. Internally it is simply using the image module's formatter as well as the _imagefield_crop_file_to_crop() function.

P.S.: Linking related duplicate issue.