Comments (7)
So what you're looking for is an after_processing callback to bust the cache. Delayed_paperclip should observe paperclip's callback after_post_process
. Let me know if your expiring fragment doesn't work there.
from delayed_paperclip.
Are you still experiencing this issue?
from delayed_paperclip.
I also ran into this issue. Maybe the split processing might be related, but I doubt it? The callback fires when the images are done (not delayed), even if I set the callback to on the video attribute specifically (after_video_post_process).
from delayed_paperclip.
I had this same issue and was able to figure out a relatively happy solution.
For me there was no need to monkeypatch the delayed_paperclip DelayedJob ... I created an ActiveRecord concern called 'has_delayed_paperclip' and setup an 'after_post_process' callback hook in there to invoke a 'clear_cache' method.
Here's a gist I created with the concern:
https://gist.github.com/kevinmtrowbridge/ca3435054d22eb2d2ac1
Once you've stuck that in the models/concerns directory, you can setup delayed_paperclip within models using your wrapper method like:
custom_process_in_background :image
from delayed_paperclip.
@alexcp @kevinmtrowbridge , I am also trying to display the original image while processing.
Can you give me some hints as to how did you go about it?
Where do you get the path to the original file? Are you using @queued_for_write from paperclip?
I tried passing a symbol with the name of the method to :processing_image_url, so that it would dynamically choose the path for the image to display for each model. But at the time this method is called, @queued_for_write is empty, leaving me unable to set the path to the original for the time of processing.
from delayed_paperclip.
I'm pretty sure the original filename is just there via image_tag model.paperclip_image
while processing. The original gets copied into place immediately and is available immediately.
The styles, the images of different sizes or coloring options, that paperclip creates, those are not available while processing. Please see this section of the documentation for more information about that.
This thread is about clearing a cache or carrying out some other action, after the processing has finished. Do you need to do something like that?
from delayed_paperclip.
@kevinmtrowbridge , thank for your answer!
I was hoping it can be done not in the view.
I created a new issue where I explain what I would like to achieve:
#99.
from delayed_paperclip.
Related Issues (20)
- Latest commit to paperclip master breaks gem HOT 1
- undefined method `[]=' for nil:NilClass HOT 2
- Delayed Job w/ s3, Missing required :bucket option error HOT 11
- FFMPEG hangs/stalls when converting large files HOT 1
- Errors are silently swallowed instead of being raised to the background processor HOT 1
- Needs a failure callback
- Not saving original file - only those styles specified in only_process are created HOT 4
- paperclip-document style is not working with background
- Gem doesn't work with S3 HOT 4
- Handle Record Not Found Exceptions HOT 2
- NoMethodError: undefined method `fetch' for nil:NilClass with postgres HOT 1
- Release latest changes in master
- Support Priority of DelayedJob. HOT 2
- Processors not being called HOT 2
- Job failed to load: undefined class/module DelayedPaperclip
- Linking existing S3 object to Paperclip does not trigger Delayed::Job HOT 1
- Not generating cropped images when using papercrop
- Creates original style twice on S3
- How to skip process_in_background method call in some case
- Avoid creating jobs when nothing to process
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from delayed_paperclip.