Comments (16)
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.
@talklittle this looks really good. I really appreciate you taking this over and pushing it to completion.
from mogrify.
@mguterl I thought about current design too and I agree with you! Go ahead let's make it better!
from mogrify.
Thanks @route! I'll send something over in the next few days.
from mogrify.
Hey @mguterl have you started working on this? I can help.
from mogrify.
@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.
@mguterl no rush, it's done when it's done. Get better!
from mogrify.
Hey guys! Any updates?
from mogrify.
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.
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.
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.
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.
I'll pickup this work
from mogrify.
Created a PR building off @mguterl's work, adding batching for format/2
and the newer functions auto_orient/1
and custom/3
.
from mogrify.
#12 was merged, so my first action as GitHub repo collaborator is to close this issue. Hooray
from mogrify.
Thanks everyone 👍
from mogrify.
Related Issues (20)
- Print the command-line command during, or instead of, execution
- (RuntimeError) missing prerequisite: 'convert' HOT 2
- Can I get size of buffered image? HOT 4
- Limit memory?
- release new version? HOT 1
- Svg to png font error HOT 1
- format to image to PDF
- Trying to setup testing on mac. HOT 4
- image not saved if the folder doesn't exist HOT 2
- create new image with background fails HOT 2
- Format isn't applied if an image is saved without an extension HOT 3
- Adding text to an image
- Annotate only prints one word of the annotation HOT 2
- [Question] - Conversion from HEIC to jpg HOT 3
- System.cmd should call `magick mogrify` instead of `mogrify` HOT 3
- Failing test(s) due to different resize output on Windows and Linux HOT 2
- Image struct is not updated with new format when saved in-place
- Adding caption on image HOT 1
- extract_histogram_data is broken `Enumerable not implemented for nil of type Atom` HOT 2
- Issue overwriting image when in_place is not specified HOT 4
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
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.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from mogrify.