GithubHelp home page GithubHelp logo

Resize animated gif about arc HOT 3 CLOSED

stavro avatar stavro commented on August 16, 2024
Resize animated gif

from arc.

Comments (3)

stavro avatar stavro commented on August 16, 2024

Are you sure that the above operation requires two calls to convert?

All of the examples here use one call to convert: http://www.imagemagick.org/Usage/anim_mods/#resize

eg: convert script_k.gif -coalesce -resize 20x20 script_k_direct2.gif

from arc.

gitviola avatar gitviola commented on August 16, 2024

I tried it with the parameters mentioned above:

def transform(:thumb, {file, _scope}) do
    file_extension = file.file_name |> Path.extname
    case file_extension do
      ".gif" -> {:convert, "-coalesce -resize 250x250 -gravity center -extent 250x250"}
      _      -> {:convert, "-strip -thumbnail 250x250 -gravity center -extent 250x250"}
    end
  end

  def transform(:medium, {file, _scope}) do
    file_extension = file.file_name |> Path.extname
    case file_extension do
      ".gif" -> {:convert, "-coalesce -resize 700x700"}
      _      -> {:convert, "-quality 80 -strip -thumbnail 700x700> -gravity center"}
    end
  end

It takes forever and after a while there is a timeout

** (UndefinedFunctionError) undefined function :timeout.__struct__/1 (module :timeout is not available)
        :timeout.__struct__({:timeout, {Task, :await, [%Task{owner: #PID<0.1684.0>, pid: #PID<0.1689.0>, ref: #Reference<0.0.1.26960>}, 15000]}})

from arc.

stavro avatar stavro commented on August 16, 2024

This should be done through https://github.com/stavro/arc#complex-transformations for now.

from arc.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo 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.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.