Line 531 of imagefield_crop.module: 'path' => $file_to_crop->uri,

The path should probably point to the styled image, but I'm not sure how to set this up properly so that the styled image is also the one that's #processed. The image style itself is available in $widget_settings['preview_image_style'].

Is there a way to specify an image style in the $file object in Drupal 7 or must it all be handled manually?

Comments

charlie-s’s picture

This is how I've temporarily hacked this to work...

Line 512 of imagefield_crop.module:

<?php
if (isset($widget_settings['preview_image_style'])) {
  $file_to_crop->uri = str_replace('public://', 'public://styles/' . $widget_settings['preview_image_style'] . '/public/', $file_to_crop->uri);
}
?>

It wasn't enough to simply change the 'path' in the form element because this object is also used in the #process function.

simeonkesmev’s picture

Issue summary: View changes

Seems that the setting "Preview image style" is coming from the default image widget and is not used anywhere in this module. A preview box sizing setting is not implemented at all.

simeonkesmev’s picture

Status: Active » Needs review
StatusFileSize
new2.16 KB

Here is the feature implemented.

simeonkesmev’s picture

StatusFileSize
new4.53 KB

*Please remove comment*

eugene.ilyin’s picture

Status: Needs review » Reviewed & tested by the community

#4 works for me! Thank you for your patch

ram4nd’s picture

Status: Reviewed & tested by the community » Patch (to be ported)

  • ram4nd committed be16183 on 7.x-2.x authored by SimeonKesmev
    Issue #1375668 by SimeonKesmev, csdco, eugene.ilyin, ram4nd: "Preview...
ram4nd’s picture

Status: Patch (to be ported) » Fixed
eugene.ilyin’s picture

Very strange. Patch was commited, but when I tried to dowload the last dev version, this patch isn't exists in it.

Status: Fixed » Closed (fixed)

Automatically closed - issue fixed for 2 weeks with no activity.

eugene.ilyin’s picture