Closed (works as designed)
Project:
Image Widget Crop
Version:
8.x-2.2
Component:
Crop
Priority:
Normal
Category:
Support request
Assigned:
Unassigned
Reporter:
Created:
23 Dec 2019 at 09:37 UTC
Updated:
10 Feb 2021 at 07:21 UTC
Jump to comment: Most recent
Comments
Comment #2
hirani89 commentedI am having the same issue for some images as well. specially the big ones.
Comment #3
hirani89 commentedI am having an issue where when creating a node and creating a cropped image, the cropped is not created. But when I go and edit the node, the cropped image gets created.
Comment #4
hirani89 commentedOk. So I have done some more debugging. What I realised is that the function
loadImageStyleByCrop()is called before an entry is made in thecrop_field_datatable. When thefindCropfunction is run to get the file uri from the db, it does not exist in the db yet.Comment #5
hirani89 commentedOk. So the Issue is that this module is not designed for decoupled/headless drupal. Like I mentioned in the comment above, the cropped image does not get created when a node is created. It gets created when it is accessed by a drupal theme or the node is edited.
So the workaround I came up with was to redirect to edit page after creating a node.
Hope this helps anyone having this issue.
Comment #6
woprrr commentedHi @hirani89,
All mentioned here isn't a iwc work but Crop API. I'm the maintainer too and ATM the management of ImageStyle for Headless are poor IMHO you will use lot of custom works to be OK. IWC is a full UX module that allow ability to use Crop API.
For initial problem please check your server permissions it's not a IWC concern.
Comment #7
hirani89 commentedHi @Woprrr
Is there a work around for this in terms of headless Drupal? May be there is a hook I can add which can call the Crop API when a node is created. That way, I don't have to redirect users to the edit page.
Comment #8
hirani89 commentedUse Image Style Warmer
Comment #9
astringer commentedImage Style Warmer worked great for me. (I am not headless, but have an inline style for a background image, and the image was not generating).
Thank you.