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
Is your feature request related to a problem? Please describe.
We've been using Paperclip for a while in Mastodon, and we're chaining processors. Sometimes, a processor can decide it doesn't need to perform any change to the file. In this case, we just re-open the file to pass it to the next processor:
classLazyThumbnail < Paperclip::ThumbnaildefmakereturnFile.open(@file.path)unlessneeds_convert?# … actual codeendend
This worked up until Paperclip 6.1, which caused the files to be closed after each processor in thoughtbot@90f9121, resulting in Errno::ENOENT errors.
This behavior remains unchanged in kt-paperclip so I was wondering how to best implement this “lazy” processor.
kt-paperclip should maybe unlink the original tempfile only once it has been fully processed. Pushing original into intermediate_files instead of immediately unlinking it should do the trick.
Describe alternatives you've considered
Our LazyThumbnail could create a copy of the file, but it seems wasteful.
The text was updated successfully, but these errors were encountered:
Is your feature request related to a problem? Please describe.
We've been using Paperclip for a while in Mastodon, and we're chaining processors. Sometimes, a processor can decide it doesn't need to perform any change to the file. In this case, we just re-open the file to pass it to the next processor:
This worked up until Paperclip 6.1, which caused the files to be closed after each processor in thoughtbot@90f9121, resulting in
Errno::ENOENT
errors.This behavior remains unchanged in
kt-paperclip
so I was wondering how to best implement this “lazy” processor.Looking at https://github.com/kreeti/kt-paperclip/blob/master/lib/paperclip/attachment.rb#L523-L530, there seem to be no clear way to handle that case.
Describe the solution you'd like
kt-paperclip should maybe unlink the original tempfile only once it has been fully processed. Pushing
original
intointermediate_files
instead of immediately unlinking it should do the trick.Describe alternatives you've considered
Our
LazyThumbnail
could create a copy of the file, but it seems wasteful.The text was updated successfully, but these errors were encountered: