Comments (8)
Sounds like a good idea, though I'd have to think of the right CLI interface, since right now it's pngpaste thefile.png
, so perhaps pngpaste --auto-detect-extension thefile
or pngpaste -a thefile
? Either way, I can try to incorporate any format detection code this week if you have any contributions there.
from pngpaste.
You might even skip autodetection for now - just use the target extension, i.e.:
pngpaste foo.png // will copy PNG
pngpaste bar.jpg // will copy JPEG
I am not osx dev, but looking the code, can you simply replace png
with jpeg
and make it work ;)))?
from pngpaste.
Yeah true, that's much simpler, though would pngpaste
be responsible for performing a conversion?
I'll take a look this week and update this issue.
from pngpaste.
Thank you!
what conversion? you mean from png to jpg, or? Would it be possible that when I copy a jpg file (like from webpage), simply store that content in a file, without any conversion?
from pngpaste.
what conversion? you mean from png to jpg, or? Would it be possible that when I copy a jpg file (like from webpage), simply store that content in a file, without any conversion?
Yeah, I mean if the user has copied a JPEG, but tries pngpaste some.png
, or the user has copied a PNG, but tries pngpaste some.jpg
.
from pngpaste.
Got it. Well, for the first version you can just throw an error; if conversion is too much work :)
I would not expect from your tool to do conversion, that might be out of scope, and conversions may be complex. I would rather work on autodetection so when you don't specify the extension:
pngpaste foo
it will detect the right pic format and store it in eg foo.jpg
or foo.png
or foo.tiff
:)
from pngpaste.
So unfortunately I dug into it and AppKit's API doesn't expose the original source's format. It just comes back as a "bitmap" and there's no clear enum or string that indicates whether the source was a JPEG, a PNG, a GIF, etc.
Thus, #9 does allow for pngpaste foo.jpg
but there's no auto-detection of the actual source. This is the data structure provided - https://developer.apple.com/reference/appkit/nsbitmapformat?language=objc - and it is not quite helpful in the detection endeavor.
from pngpaste.
Going ahead and closing this.
from pngpaste.
Related Issues (17)
- Tagging a version (for homebrew) HOT 2
- pngcopy HOT 9
- I have got an empty image with pngpaste in OSX 10.12 HOT 7
- Problem in Building! HOT 1
- Add option to output to stdout HOT 1
- The color looks like not well when I used pngpaste in Mac Mojave HOT 18
- paste animated gif
- State that it's for MacOS in README and description HOT 1
- gif animation HOT 3
- Allow raw binary dump HOT 2
- rosetta error: /var/db/oah..../pngpaste.aot: attachment of code signature supplement failed: 1 HOT 3
- Error: "261:313: execution error: sh: /us/local bin/pngpaste: No such file or directory (127)" HOT 4
- Segmentation fault
- Does Not Build on OS X 10.9 Mavericks HOT 1
- Any chance for a jpgpaste? HOT 1
- Newer tags with lower version numbers HOT 3
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 pngpaste.