Comments (6)
Thanks for the issue. Can you post your full paperclip and delayed_paperclip configuration?
This sounds similar to this. Does it work properly without delayed paperclip?
from delayed_paperclip.
I'll try to do that later today. I can't see how it would work incorrectly without delayed paperclip -- if the file is uploaded and the asset is saved in that same process, then the missing image wouldn't be linked at all.
Walter
On Nov 13, 2013, at 10:33 AM, Scott Carleton wrote:
Thanks for the issue. Can you post your full paperclip and delayed_paperclip configuration?
This sounds similar to this. Does it work properly without delayed paperclip?
—
Reply to this email directly or view it on GitHub.
from delayed_paperclip.
I'm having the same issue and it looks like it could only happen in delayed_paperclip. In my config the only thing referencing the missing
files is delayed_paperclip.
This is my config:
class MediaBlock < ActiveRecord::Base
# ...
has_attached_file :cover,
styles: { thumb: "50x50>", small: "480x240^", large: "480x480^" },
convert_options: { small: "-gravity center -crop 440x240+0+0 +repage" }
process_in_background :cover, processing_image_url: "/media-missing/:style/missing.png"
# ...
end
I though it was a conflict of the media
directory at first, but renaming it to media-missing
and having the directory still clear is kind of strange. My media-missing
directory contains missing images for the thumb
, small
, large
and original
styles. When it is cleared during the job the thumb
, small
and large
directory are cleared while the original
directory is removed completely.
I looked through the delayed_paperclip codebase, but couldn't find a place where this could easily happen accidentally. Maybe it's paperclip throwing them away thinking these files were previous uploads and then replacing them with new ones throwing the old ones away?
Note: I have paperclip configured with S3, as in the other issue, using the fog
gem, but this happens in development (on my machine, without S3 configured) as well.
from delayed_paperclip.
This was what I surmised as well.
Walter
On Dec 2, 2013, at 9:52 AM, Tom de Bruijn wrote:
Maybe it's paperclip thinking these files are uploads and then replaced with new one throwing the old ones away?
from delayed_paperclip.
Sorry walter, thought you never tried it with the processing_image_url
.
Monkey patched it for now with this in my app:
def cover_url(style = :original)
if cover_processing?
ActionController::Base.helpers.asset_path("media-missing/#{style}/missing.png")
else
cover.url(style)
end
end
media.cover.url(:thumb) => media.cover_url(:thumb)
So I'm not using the processing_image_url
or missing images anymore.
from delayed_paperclip.
This looks very useful. Thanks for the update. I ended up using the processing_image_url without the missing images in base paperclip, and that worked as well (although I lost the desired behavior of missing_url). Your way looks to be more correct for my purposes.
It really does seem that paperclip believes that the missing image is the real file owned by the model, and so as in a normal update, deletes it before attaching the delayed processed version. On the production app that I'm aiming this toward, we already use the keep deleted assets behavior, so it might still work there, but I think your technique is more expressive and thus more likely to land when I implement this feature for real.
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.