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

Timout when transforming image #85

Open
svennerberg opened this issue Dec 20, 2017 · 1 comment
Open

Timout when transforming image #85

svennerberg opened this issue Dec 20, 2017 · 1 comment

Comments

@svennerberg
Copy link

Whenever I try to convert images to something a bit larger than 640px or so I get a timeout. I have tried to increase the timeout time to up to 2 minutes but it doesn't complete before that either.

The same problem happens on both my local machine and on Heroku.

I guess this problem has something to do with Image Magick but I basically do the same conversions using paperclip on Rails without any problems.

Have anybody else experienced the same problem? Are there workarounds?

This is what my definition looks like:

defmodule Succinct.FeaturedImage do
  use Arc.Definition
  use Arc.Ecto.Definition

  @acl :public_read
  @versions [:original, :thumb, :small]

  def validate({file, _}) do
    ~w(.jpg .jpeg .gif .png) |> Enum.member?(Path.extname(file.file_name))
  end

  # Transformations
  def transform(:thumb, _) do
    {:convert, "-strip -thumbnail 250x250^ -gravity center -extent 250x250 -format png", :png}
  end

  def transform(:small, _) do
    {:convert, "-strip -resize 640x640> -quality 80", :jpg}
  end

  def transform(:large, _) do
    {:convert, "-strip -resize 1400x1400> -quality 60 -format jpg", :jpg}
  end

end
@pedep
Copy link

pedep commented Jan 4, 2018

What happens when you run the command manually?
I get an error running convert test.jpg -strip -resize 1400x1400> -quality 60 -format jpg out.jpg in both bash and zsh.
This should be solved by escaping the > (becomes \>) like they do in the documentation

If this does not work, you could try setting @async false to see if the commands ever finishes

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

No branches or pull requests

2 participants