Giter VIP home page Giter VIP logo

Comments (16)

talklittle avatar talklittle commented on August 15, 2024 1

One change I made to the original proposal is giving save/2 a couple options: :in_place and :path

So there's 3 variants:

# temp dir
image = open("input.jpg") |> resize("100x100") |> save

# specify a path
image = open("input.jpg") |> resize("100x100") |> save(path: "new.jpg")

# overwrite original; ignores :path option if specified
image = open("input.jpg") |> resize("100x100") |> save(in_place: true)

from mogrify.

mguterl avatar mguterl commented on August 15, 2024 1

@talklittle this looks really good. I really appreciate you taking this over and pushing it to completion.

from mogrify.

route avatar route commented on August 15, 2024

@mguterl I thought about current design too and I agree with you! Go ahead let's make it better!

from mogrify.

mguterl avatar mguterl commented on August 15, 2024

Thanks @route! I'll send something over in the next few days.

from mogrify.

imranismail avatar imranismail commented on August 15, 2024

Hey @mguterl have you started working on this? I can help.

from mogrify.

mguterl avatar mguterl commented on August 15, 2024

@imranismail - I have everything complete except format. https://github.com/mguterl/mogrify/tree/batch-operations-into-single-command

I was sick all of last week so I'm a bit behind, but finishing up format shouldn't be too hard. It is different than the other operations because it requires changing the extension of the filename generated.

from mogrify.

route avatar route commented on August 15, 2024

@mguterl no rush, it's done when it's done. Get better!

from mogrify.

route avatar route commented on August 15, 2024

Hey guys! Any updates?

from mogrify.

mbriggs avatar mbriggs commented on August 15, 2024

about to use mogrify for a work project, I wouldnt mind helping get this out if there is stuff still to be done

from mogrify.

mguterl avatar mguterl commented on August 15, 2024

I haven't updated anything since my last comment, everything except for the format command is supported here: https://github.com/mguterl/mogrify/tree/batch-operations-into-single-command

from mogrify.

tomjoro avatar tomjoro commented on August 15, 2024

Hi, great stuff.. was looking at how this is progressing, and have a few questions/notes.

I've was looking at https://github.com/minimagick/minimagick. In the current proposal (this issue) there's no way to differentiate between sequential execution, and combining options in a single run. It would be nice if it were possible to somehow specify this.

From minimagick:

image.combine_options do |b|
  b.resize "250x200>"
  b.rotate "-90"
  b.flip
end # the command gets executed

# the following executes in separate commands

  image.resize "200x200>"
  image.rotate "-90"
  image.write "output.png"

Maybe?? " |> batch |> resize("200x200>") |> rotate("-90") |> run"??

also, the current 'copy' is interesting. In minimagick it's just specified up front when you 'open' or 'new' the file. Can 'copy' be applied multiple times in the current pipeline?

from mogrify.

mbriggs avatar mbriggs commented on August 15, 2024

as someone who has done a LOT of work with minimagick, pretty much the only time you dont want to combine options is when you start working off of a different set of inputs. I think in terms of elixir syntax, it makes sense that combine_options maps to a pipeline, if you want to do a different set of operations on a new set of inputs, start a new pipeline.

from mogrify.

route avatar route commented on August 15, 2024

I'll pickup this work

from mogrify.

talklittle avatar talklittle commented on August 15, 2024

Created a PR building off @mguterl's work, adding batching for format/2 and the newer functions auto_orient/1 and custom/3.

#12

from mogrify.

talklittle avatar talklittle commented on August 15, 2024

#12 was merged, so my first action as GitHub repo collaborator is to close this issue. Hooray

from mogrify.

route avatar route commented on August 15, 2024

Thanks everyone 👍

from mogrify.

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.