Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

When add file extension to filename, processing using convert failed with reason no_processor #49

Open
loongmxbt opened this issue Sep 29, 2016 · 3 comments
Labels

Comments

@loongmxbt
Copy link

loongmxbt commented Sep 29, 2016

<%= exfile_path(@paper.file, filename: "PID#{@paper.id}-CID#{@topic.id}") %>
# URI
http://localhost:4000/attachments/f_LMR2YRJf7VRSrYEuKSmIYP0SXDilBiesY7lbhJqWY=/store/d907666bb877f897119308dfaa65cb96a6f827f6e089cb498bf7290548da/PID1-CID1

works fine.

But when add .pdf or other file extensions

<%= exfile_path(@paper.file, filename: "PID#{@paper.id}-CID#{@topic.id}.pdf") %>
# URI
http://localhost:4000/attachments/TpZXUPYiDwdC5B3S75Ju9aF1pFPM3iby8sHGE6X_ngE=/store/d907666bb877f897119308dfaa65cb96a6f827f6e089cb498bf7290548da/PID1-CID1.pdf

It shows

processing using convert failed with reason no_processor

Any ideas how to add extension for download?

PS:

If I use format: "pdf", seems nothing changes.

Press CTRL+S the filename still have no extension like PID1-CID1
# URI
http://localhost:4000/attachments/f_LMR2YRJf7VRSrYEuKSmIYP0SXDilBiesY7lbhJqWY=/store/d907666bb877f897119308dfaa65cb96a6f827f6e089cb498bf7290548da/PID1-CID1
@keichan34 keichan34 added the bug label Sep 29, 2016
@loongmxbt
Copy link
Author

Using exfile-imagemagick and imagemagick solves the "file rename problem".

@scarfacedeb
Copy link
Contributor

scarfacedeb commented Oct 30, 2017

I have a similar issue.

I'm serving .pdf files and identify -format %w <file> commands takes too long to run, giving me GenServer Timeout error. (I'm using master branch of ExfileImagemagick)

I compared the source code of refile and exfile and noticed that refile skips the file conversion when there's no processor in the url. Conversely, exfile always tries to convert the file when format is present in the url.

@keichan34 what do you think about adding the whitelist of extensions that support format conversion?

It could process all of the formats by default to keep backwards compatibility.

@scarfacedeb
Copy link
Contributor

@keichan34 I've updated my fork of exfile to support whitelisted formats.

If you're interested, here's the relevant commit: scarfacedeb@6d1b0d2

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

3 participants