You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
The gem currently doesn't work with those, because it relies on virtual attributes as defined in crop_uploaded. These attributes are not persisted and since Delayed Job simply stores/retrieves the object by its ID these values will not be available when the processing happens.
I see two solutions for this:
One is solution is adding additional methods to ActiveRecord to serialize these virtual attributes for Delayed Job. This solution is described here, but doesn't seem particularly elegant.
The other solution is to actually store the crop attributes in the database, rather than using virtual attributes. This way the attributes persist and are available to the Delayed Job worker. The attributes can be set to nil once processing is completed so cropping? will only be true if the attributes are set again.
I've been able to make some progress on implementing the latter solution, but I'm still not 100% there yet. For some reason the images are only cropped when a new image is uploaded, but not when the crop attributes are changed.
Any suggestions on how to make it work, or how to debug it?
The text was updated successfully, but these errors were encountered:
Did some more digging and apparently since I'm using For (S3 cloud storage) things get a little bit tricker. After adding the code linked in that article though, I still haven't been able to successfully fire recreate_versions except for new uploads.
@marckohlbrugge My apologies for late reply. I am working on issue #3 and it will provide the option to specify and save the crop attributes in database. Will that work for you? Also, were you able to solve the issue with S3? Let me know.
Would you consider making this gem compatible with CarrierWave Backgrounder and Delayed::Job?
The gem currently doesn't work with those, because it relies on virtual attributes as defined in
crop_uploaded
. These attributes are not persisted and since Delayed Job simply stores/retrieves the object by its ID these values will not be available when the processing happens.I see two solutions for this:
One is solution is adding additional methods to ActiveRecord to serialize these virtual attributes for Delayed Job. This solution is described here, but doesn't seem particularly elegant.
The other solution is to actually store the crop attributes in the database, rather than using virtual attributes. This way the attributes persist and are available to the Delayed Job worker. The attributes can be set to
nil
once processing is completed socropping?
will only be true if the attributes are set again.I've been able to make some progress on implementing the latter solution, but I'm still not 100% there yet. For some reason the images are only cropped when a new image is uploaded, but not when the crop attributes are changed.
Any suggestions on how to make it work, or how to debug it?
The text was updated successfully, but these errors were encountered: