Giter Club home page Giter Club logo

pngpaste's Introduction

pngpaste

Paste PNG into files on MacOS, much like pbpaste does for text.

However instead of pngpaste > thefile.png, it's pngpaste thefile.png, so one does not accidentally barf binary into the console.

Motivation

http://apple.stackexchange.com/q/11100/4795

Build

$ make all

Installation

From source:

$ make all
$ sudo make install

Or with Homebrew:

$ brew install pngpaste

Usage

$ pngpaste hooray.png

Bonus and Disclaimers

Supported input formats are PNG, PDF, GIF, TIF, JPEG.

Supported output formats are PNG, GIF, JPEG, TIFF.

Output formats are determined by the provided filename extension, falling back to PNG.

It's unclear if EXIF data in JPEG sources are preserved. There's an issue with pasting into JPEG format from a GIF source.

Error Handling

Minimal :'(

pngpaste's People

Contributors

jcsalterego avatar joonhwan avatar stef-levesque avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

pngpaste's Issues

State that it's for MacOS in README and description

Thanks for this project, it's fantastic to have this functionality.

I'd like to suggest changing the README and repo description to say

Paste PNG into files on MacOS, much like pbpaste does for text.

Currently the only clue that it's MacOS only is the apple.stackexchange link.

Format agnostic tool?

Would it be possible to make it format agnostic? e.g. to detect JPG and store as JPG... I would not like to clone just to make a jpg version of it; would it be cool to have it all in one.
wdyt?

Problem in Building!

Hello,
i have Problem in Building.

$ make

cc -Wall -g -O3 -ObjC \
	-framework Foundation -framework AppKit \
	-o pngpaste \
	pngpaste.m
cc: error: Foundation: No such file or directory
cc: error: AppKit: No such file or directory
cc: error: unrecognized command line option ‘-framework’
cc: error: unrecognized command line option ‘-framework’
make: *** [Makefile:3: all] Error 1

how can fix?

pngcopy

Now if only I could do this:

pngpaste - | convert - -resize 50% - | pngcopy

Allow raw binary dump

Hello,

Thanks for the work with pngpaste.

I would like to have a flag (possible values are, for example, --raw and --binary — you might come with something better) that would allow pngpaste to behave like pbpaste.

That way, I can pipe the raw content to another process, such as curl, and upload it directly from memory, without having to create a temp file for that.

Is this something you could do, or should I educate myself with the source and create a PR?

Thanks.

gif animation

pngpaste will only paste or base64 convert image data of the first frame of an animation.

It would be nice to output the entire file data, instead.

Does Not Build on OS X 10.9 Mavericks

cc -Wall -g -O3 -ObjC \
        -framework Foundation -framework AppKit \
        -o pngpaste \
        pngpaste.m
In file included from /System/Library/Frameworks/CoreFoundation.framework/Headers/CFBase.h:68,
                 from /System/Library/Frameworks/CoreFoundation.framework/Headers/CoreFoundation.h:38,
                 from /System/Library/Frameworks/Foundation.framework/Headers/Foundation.h:6,
                 from pngpaste.h:5,
                 from pngpaste.m:5:
/usr/include/MacTypes.h: In function ‘Debugger’:
/usr/include/MacTypes.h:699: error: expected declaration specifiers before ‘__AVAILABILITY_INTERNAL__MAC_10_0_DEP__MAC_10_8’
/usr/include/MacTypes.h:711: error: expected ‘=’, ‘,’, ‘;’, ‘asm’ or ‘__attribute__’ before ‘__AVAILABILITY_INTERNAL__MAC_10_0_DEP__MAC_10_8’
/usr/include/MacTypes.h:758: error: expected ‘=’, ‘,’, ‘;’, ‘asm’ or ‘__attribute__’ before ‘__AVAILABILITY_INTERNAL__MAC_10_0_DEP__MAC_10_8’
/usr/include/MacTypes.h:770: error: expected ‘=’, ‘,’, ‘;’, ‘asm’ or ‘__attribute__’ before ‘__AVAILABILITY_INTERNAL__MAC_10_0_DEP__MAC_10_8’
/usr/include/MacTypes.h:782: error: expected ‘=’, ‘,’, ‘;’, ‘asm’ or ‘__attribute__’ before ‘__AVAILABILITY_INTERNAL__MAC_10_0_DEP__MAC_10_8’
/usr/include/MacTypes.h:792: error: expected declaration specifiers before ‘#pragma’
<snip>
In file included from pngpaste.m:5:
pngpaste.h:19: error: expected declaration specifiers before ‘ImageType’
pngpaste.h:23: error: expected specifier-qualifier-list before ‘NSString’
pngpaste.h:27: error: storage class specified for parameter ‘Parameters’
pngpaste.h:33: error: expected declaration specifiers before ‘ImageType’
pngpaste.h:34: error: expected declaration specifiers before ‘NSData’
pngpaste.h:35: error: expected declaration specifiers before ‘NSData’
pngpaste.h:36: error: expected declaration specifiers before ‘NSData’
pngpaste.h:38: error: expected declaration specifiers before ‘Parameters’
pngpaste.h:40: warning: ‘main’ is usually a function
pngpaste.m:9: error: expected ‘=’, ‘,’, ‘;’, ‘asm’ or ‘__attribute__’ before ‘{’ token
pngpaste.m:19: error: expected ‘=’, ‘,’, ‘;’, ‘asm’ or ‘__attribute__’ before ‘{’ token
pngpaste.m:27: error: expected ‘=’, ‘,’, ‘;’, ‘asm’ or ‘__attribute__’ before ‘{’ token
pngpaste.m:31: error: expected declaration specifiers before ‘ImageType’
pngpaste.m:46: error: expected declaration specifiers before ‘NSData’
pngpaste.m:64: error: expected declaration specifiers before ‘NSData’
pngpaste.m:73: error: expected declaration specifiers before ‘NSData’
pngpaste.m:97: error: expected declaration specifiers before ‘Parameters’
pngpaste.m:138: error: expected ‘=’, ‘,’, ‘;’, ‘asm’ or ‘__attribute__’ before ‘{’ token
pngpaste.m:170: error: old-style parameter declarations in prototyped function definition
pngpaste.m:170: error: expected ‘{’ at end of input
make: *** [all] Error 1

paste animated gif

Hi!
Is it possible to add paste of an animated gif?
Currently it does paste only the icon of it:

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.