GithubHelp home page GithubHelp logo

oily_png's People

Contributors

donv avatar doriath avatar edwardbetts avatar lencioni avatar pushmatrix avatar wvanbergen 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

oily_png's Issues

Is it possible to install oily_png with just the Command Line Tools?

Hi there,

To save on space i'm using just the XCode Command Line Tools instead of the whole shebang. I'm running into this on installation:

/System/Library/Frameworks/Ruby.framework/Versions/1.8/usr/bin/ruby extconf.rb
creating Makefile

make
xcrun cc -I. -I/System/Library/Frameworks/Ruby.framework/Versions/1.8/usr/lib/ruby/1.8/universal-darwin12.0 -I/System/Library/Frameworks/Ruby.framework/Versions/1.8/usr/lib/ruby/1.8/universal-darwin12.0 -I. -D_XOPEN_SOURCE -D_DARWIN_C_SOURCE   -fno-common -arch i386 -arch x86_64 -g -Os -pipe -fno-common -DENABLE_DTRACE  -fno-common  -pipe -fno-common  -Wall  -c color.c
xcrun: Error: failed to exec real xcrun. (No such file or directory)
xcrun cc -I. -I/System/Library/Frameworks/Ruby.framework/Versions/1.8/usr/lib/ruby/1.8/universal-darwin12.0 -I/System/Library/Frameworks/Ruby.framework/Versions/1.8/usr/lib/ruby/1.8/universal-darwin12.0 -I. -D_XOPEN_SOURCE -D_DARWIN_C_SOURCE   -fno-common -arch i386 -arch x86_64 -g -Os -pipe -fno-common -DENABLE_DTRACE  -fno-common  -pipe -fno-common  -Wall  -c oily_png_ext.c
xcrun: Error: failed to exec real xcrun. (No such file or directory)
xcrun cc -I. -I/System/Library/Frameworks/Ruby.framework/Versions/1.8/usr/lib/ruby/1.8/universal-darwin12.0 -I/System/Library/Frameworks/Ruby.framework/Versions/1.8/usr/lib/ruby/1.8/universal-darwin12.0 -I. -D_XOPEN_SOURCE -D_DARWIN_C_SOURCE   -fno-common -arch i386 -arch x86_64 -g -Os -pipe -fno-common -DENABLE_DTRACE  -fno-common  -pipe -fno-common  -Wall  -c operations.c
xcrun: Error: failed to exec real xcrun. (No such file or directory)
xcrun cc -I. -I/System/Library/Frameworks/Ruby.framework/Versions/1.8/usr/lib/ruby/1.8/universal-darwin12.0 -I/System/Library/Frameworks/Ruby.framework/Versions/1.8/usr/lib/ruby/1.8/universal-darwin12.0 -I. -D_XOPEN_SOURCE -D_DARWIN_C_SOURCE   -fno-common -arch i386 -arch x86_64 -g -Os -pipe -fno-common -DENABLE_DTRACE  -fno-common  -pipe -fno-common  -Wall  -c png_decoding.c
xcrun: Error: failed to exec real xcrun. (No such file or directory)
xcrun cc -I. -I/System/Library/Frameworks/Ruby.framework/Versions/1.8/usr/lib/ruby/1.8/universal-darwin12.0 -I/System/Library/Frameworks/Ruby.framework/Versions/1.8/usr/lib/ruby/1.8/universal-darwin12.0 -I. -D_XOPEN_SOURCE -D_DARWIN_C_SOURCE   -fno-common -arch i386 -arch x86_64 -g -Os -pipe -fno-common -DENABLE_DTRACE  -fno-common  -pipe -fno-common  -Wall  -c png_encoding.c
xcrun: Error: failed to exec real xcrun. (No such file or directory)
xcrun cc -I. -I/System/Library/Frameworks/Ruby.framework/Versions/1.8/usr/lib/ruby/1.8/universal-darwin12.0 -I/System/Library/Frameworks/Ruby.framework/Versions/1.8/usr/lib/ruby/1.8/universal-darwin12.0 -I. -D_XOPEN_SOURCE -D_DARWIN_C_SOURCE   -fno-common -arch i386 -arch x86_64 -g -Os -pipe -fno-common -DENABLE_DTRACE  -fno-common  -pipe -fno-common  -Wall  -c resampling.c
xcrun: Error: failed to exec real xcrun. (No such file or directory)
cc -arch i386 -arch x86_64 -pipe -bundle -undefined dynamic_lookup -o oily_png.bundle color.o oily_png_ext.o operations.o png_decoding.o png_encoding.o resampling.o -L. -L/System/Library/Frameworks/Ruby.framework/Versions/1.8/usr/lib -L. -arch i386 -arch x86_64     -lruby  -lpthread -ldl -lobjc  
clang: error: no such file or directory: 'color.o'
clang: error: no such file or directory: 'oily_png_ext.o'
clang: error: no such file or directory: 'operations.o'
clang: error: no such file or directory: 'png_decoding.o'
clang: error: no such file or directory: 'png_encoding.o'
clang: error: no such file or directory: 'resampling.o'
make: *** [oily_png.bundle] Error 1

Any idea if it's possible to do this with Command Line Tools?

Thanks.

Tests failing on 32 bits architecture

In Debian and Ubuntu, the following tests are failing when executed in armhf (32bits):

  1) OilyPNG::Color#compose_quick should use the background color as is when a fully transparent pixel is given as foreground color
     Failure/Error: expect(compose_quick(@fully_transparent, @white)).to be(@white)

       expected #<Integer:820> => 4294967295
            got #<Integer:830> => 4294967295

       Compared using equal?, which compares object identity,
       but expected and actual are not the same object. Use
       `expect(actual).to eq(expected)` if you don't care about
       object identity in this example.
     # ./spec/color_spec.rb:24:in `block (3 levels) in <top (required)>'

  2) OilyPNG::Color#compose_quick should compose pixels correctly
     Failure/Error: expect(compose_quick(@non_opaque, @white)).to be(0x9fc2d6ff)

       expected #<Integer:840> => 2680346367
            got #<Integer:850> => 2680346367

       Compared using equal?, which compares object identity,
       but expected and actual are not the same object. Use
       `expect(actual).to eq(expected)` if you don't care about
       object identity in this example.
     # ./spec/color_spec.rb:28:in `block (3 levels) in <top (required)>'

  3) OilyPNG::Color#compose_quick should compose colors exactly the same as ChunkyPNG
     Failure/Error: expect(compose_quick(fg, bg)).to be(ChunkyPNG::Color.compose_quick(fg, bg))

       expected #<Integer:860> => 2126858483
            got #<Integer:870> => 2126858483

       Compared using equal?, which compares object identity,
       but expected and actual are not the same object. Use
       `expect(actual).to eq(expected)` if you don't care about
       object identity in this example.
     # ./spec/color_spec.rb:33:in `block (3 levels) in <top (required)>'

Debian bug as reference: https://bugs.debian.org/cgi-bin/bugreport.cgi?bug=999650

I tried to change the expect(value).to be(expected) to expect(value).to eq(expected) and the tests pass, but I am not sure if this is the right fix.

SIMD?

I don't have any experience with C programming, but I am wondering if you might be able to see some performance improvements by using SIMD programming in a few places.

For instance, do you think it would benefit oily_png_compose_color to use SIMD programming? There might be a few other places where SIMD could be implemented without too much effort. But, since I have no C experience I am likely underestimating the difficulties involved.

More information on SIMD:

Problem installing oily_png on OSX

I'm getting an error when trying to install oily_png on OSX:

$ ruby -v
ruby 2.0.0p247 (2013-06-27 revision 41674) [universal.x86_64-darwin13]
$ sudo gem install oily_png
Fetching: chunky_png-1.3.0.gem (100%)
Successfully installed chunky_png-1.3.0
Fetching: oily_png-1.1.1.gem (100%)
Building native extensions.  This could take a while...
ERROR:  Error installing oily_png:
    ERROR: Failed to build gem native extension.

    /System/Library/Frameworks/Ruby.framework/Versions/2.0/usr/bin/ruby extconf.rb
creating Makefile

make "DESTDIR="
compiling color.c
compiling oily_png_ext.c
oily_png_ext.c:43:1: warning: control may reach end of non-void function [-Wreturn-type]
}
^
1 warning generated.
compiling operations.c
compiling png_decoding.c
png_decoding.c:315:1: warning: control may reach end of non-void function [-Wreturn-type]
}
^
1 warning generated.
compiling png_encoding.c
png_encoding.c:239:1: warning: control may reach end of non-void function [-Wreturn-type]
}
^
1 warning generated.
compiling resampling.c
linking shared-object oily_png/oily_png.bundle
clang: error: unknown argument: '-multiply_definedsuppress' [-Wunused-command-line-argument-hard-error-in-future]
clang: note: this will be a hard error (cannot be downgraded to a warning) in the future
make: *** [oily_png.bundle] Error 1

Note the error: clang: error: unknown argument: '-multiply_definedsuppress' [-Wunused-command-line-argument-hard-error-in-future].

According to this Stack Overflow question, it's a problem with building with XCode 5.1+ installed. I'm not sure if this is something you can fix (I don't see that code in this project), but I wanted to make you aware of it.

Release new version

Hey,

Any chance you could official release the current master to Rubygems? It includes fast rotate_left and rotate_right, which can benefit everyone.

Awesome extension, btw :).

RangeError - integer 4321678595 too big to convert to `unsigned int'

I coded a pixel manipulation (exposure and tint) that composes multiple images. The code was working A1 on chunky_png but I needed a speed boost, so I changed the require to oily_png and now the composition fails on this error:

RangeError - integer 4321678595 too big to convert to `unsigned int':
    /Users/juggy/.rvm/gems/ruby-2.1.1@t2img/gems/chunky_png-1.3.0/lib/chunky_png/color.rb:214:in `a'
    /Users/juggy/.rvm/gems/ruby-2.1.1@t2img/gems/chunky_png-1.3.0/lib/chunky_png/color.rb:214:in `opaque?'
    /Users/juggy/.rvm/gems/ruby-2.1.1@t2img/gems/chunky_png-1.3.0/lib/chunky_png/color.rb:268:in `compose_quick'
    /Users/juggy/.rvm/gems/ruby-2.1.1@t2img/gems/chunky_png-1.3.0/lib/chunky_png/canvas/operations.rb:59:in `block (2 levels) in compose!'
    /Users/juggy/.rvm/gems/ruby-2.1.1@t2img/gems/chunky_png-1.3.0/lib/chunky_png/canvas/operations.rb:58:in `each'
    /Users/juggy/.rvm/gems/ruby-2.1.1@t2img/gems/chunky_png-1.3.0/lib/chunky_png/canvas/operations.rb:58:in `block in compose!'
    /Users/juggy/.rvm/gems/ruby-2.1.1@t2img/gems/chunky_png-1.3.0/lib/chunky_png/canvas/operations.rb:57:in `each'
    /Users/juggy/.rvm/gems/ruby-2.1.1@t2img/gems/chunky_png-1.3.0/lib/chunky_png/canvas/operations.rb:57:in `compose!'

Any pointers?

If width/height is given to constructor in a non-Fixnum form, saving to disk fails.

Ran into this problem while trying to switch to oily_png for PSD.rb. Because the width and height values were read from a file using BinData, they were not stored as a typical Fixnum, but as a BinData::Uint32be. This caused oily_png to throw the confusing error:

/Users/ryanlefevre/.rvm/gems/ruby-2.0.0-p195/gems/chunky_png-1.2.8/lib/chunky_png/canvas/png_encoding.rb:174:in `encode_png_image_pass_to_stream': The number of pixels does not match the canvas dimensions. (RuntimeError)

Simply changing the initialization to this fixed the problem:

png = ChunkyPNG::Image.new(width.to_i, height.to_i, ChunkyPNG::Color::TRANSPARENT)

Not sure if this is something you want to ensure internally, but I thought I would share in case anyone else runs into a similar problem!

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.