When using the WYSIWYG, you can crop an image and the crop will be saved. But if you set the Display to "Original Size", it serves the image directly rather than any of the image styles which have the crop effect on them. However, if you set it to "Quarter Size", the cropped version will be shown correctly.

This *should* just be a matter of setting the image style for "Origin Size" to use panopoly_image_full, but I just tried that quickly in my testing and it didn't work. :-/

Comments

ergophobe’s picture

Hmmm... works fine for me unless I'm not understanding you.

It sounds like you are setting the display at admin/structure/file-types/manage/image/file-display to panopoly_image_full and having it link to the original file?

If I do that, I get the cropped image at full res on the page and when I click on it, it takes me to the file.

I played around to see what would happen if I tried to use Zurb Clearing as a formatter and am having a few issues sorting that out... but the standard Image display works fine for me.

ergophobe’s picture

@dsnopek - I know you know all this, but I'm going to offer a bit of background for people like me who are looking at this for the first time... I'm not sure I have it right, but after a few minutes with grep and some experiments, this is how I understand it....

[ I'm being long-winded as usual... I've bolded the salient points so you can scan those and go back for the details if need be.]

Newbie background on how this works

The labels are confusing and are hardcoded in function panopoly_images_media_wysiwyg_wysiwyg_allowed_view_modes_alter() in panopoly_images.module.

The labels Original Size, Quarter Size and Thumbnail just map to the media view modes for that file type of default, preview and teaser view modes, which can be set to any image style.

So it sounds from the labels like you would be choosing panopoly_image_full, panopoly_image_quarter and panopoly_image_thumbnail, but you are not choosing an image style, but a view mode as defined in admin/structure/file-types/manage/image/file-display.

So changing from Original Size to Quarter Size might or might not change the image style, but it also might or might not change the formatter. Original Size might display the raw file with no link, while Quarter Size might be using a lightbox.

Panopoly Forces WYSIWYG Crop to Full

In WYSIWYG, the base style to crop from is always panopoly_image_full (on a normal field this is settable). This is being hardcoded in this code from panopoly_images/panopoly_images.features.defaultconfig.inc

    'manualcrop_styles_list' => array(
      'panopoly_image_full' => 'panopoly_image_full',
    ),

That's just strongarm code, so I was expecting that to be settable somewhere in the UI and exported to the Feature, but I don't see where that's settable in the UI.

So that means that if you're in the WYSIWYG interface, you are always cropping panopoly_image_full which has a few important consequences.

All Panopoly Image Styles Reuse the Crop on the Full Style

Now all of the Panopoly image styles are set to reuse that crop. That's set in function panopoly_images_image_default_styles() with the 'reuse_crop_style' => 'panopoly_image_full', setting which you can set in the UI just by setting each image style.

So if you crop panopoly_image_full, you implicitly crop all other panopoly image styles , but not necessarily any others.

Making It Work

So this means that if you edit the view modes at admin/structure/file-types/manage/image/file-display, you have to have the Image Style set to one of the panopoly_image_* styles that is based on the crop of panopoly_image_full and if you want to link to the uncropped image, you have to link it to a style that does not inherit the panopoly_image_full crop.

Also, every time you edit a view mode, you have to edit and save the page that the image is on to get the image to refresh.

So in my case I have two image formatters available, the standard Image and Zurb Clearing and the following settings for the Default view mode, which maps (rather unfortunately) to the Original Size option.

Image
Image Style: panopoly_image_full
Links to: File

Zurb Clearing
Image Thumbnail Style: panopoly_image_full
Large Image Style: Original File

Those work as expected for me (but the Clearing version requires the patch I submitted for #2269343: Large Image Style cannot be set to "original image" (i.e. File) or it would alternatively require a non-cropped image style - either way, it's not a Panopoly/Media WYWISWYG/Manual Crop issue, it's a Zurb Clearing issue).

ergophobe’s picture

Does this still need to be left as Active?

dsnopek, can you confirm that with the settings I mention above this still isn't working?

dsnopek’s picture

Yes, I think this still needs to be active! It shouldn't require any configuration changes to make work, this is something that should work out of the box. I'm planning to work on it next week.

ergophobe’s picture

Ah. got it. Now I see your point.

dsnopek’s picture

Status: Active » Fixed

I finally had a chance to dig into this!

Setting the image style to panopoly_image_full isn't quite right - we label the display as "Original Size", but panopoly_image_full is responsive and will take up the full width of the region it's in. So, I added a new image style called 'panopoly_image_original' that just has the cropping effect on it.

However, I think it could be useful to have a display that does use panopoly_image_full! For example, a banner image or just having the top of an article be a full width image. So, I've created a follow-up issue: #2275823: Add 'Full width' file display for Image entities

I also found something weird with regard to file displays and made an issue to look into that later (I don't have time right now): #2275869: Investigate: panopoly_image uses "*__file_image" rather than "*__file_field_image"

  • Commit 591b891 on 7.x-1.x by dsnopek:
    Update Panopoly Images for #2269027: Fixed Cropped image not being...

Status: Fixed » Closed (fixed)

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