Giter Club home page Giter Club logo

free-image-ruby's People

Contributors

asilano avatar barmintor avatar cfis avatar tekwiz avatar wardrop avatar

Stargazers

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

Watchers

 avatar  avatar  avatar  avatar

free-image-ruby's Issues

Specify FreeImage version dependencies in the README

Hi,

It seems that free-image-ruby needs a FreeImage version > 3.10 since it works fine on my Debian testing development computer (with libfreeimage-dev-3.15.1-1) but fails on the Debian stable pre-production server with version 3.10.0-4.

(The error message reads Function 'FreeImage_HasPixels' not found in [/usr/lib64/libfreeimage.so].)

I really think a mention of the minimal FreeImage library version would be most helpful.

image composite

In cookbook, there's no example of how to do an image composite -- say for a watermark or something.

I've got code like:

wm = FreeImage::Bitmap.open(@watermark)
img = FreeImage::Bitmap.open(@file)
wm.composite(img)
wm.save(File.join(APP_ROOT, 'done.png'), :png)

but I get
FreeImage::Error: Cannot create a bitmap from a null pointer

Is composite working -- or does only composite_with_color work?

A lot of missing bytes when trying to write a bitmap to memory

memory = FreeImage::Memory.new
image = FreeImage::Bitmap.open(...)
memory.save(image, :jpeg)

memory.memory.bytes
# => "\xFF\xD8\xFF\xE0"

memory.memory.count
# => 1017134

memory.memory.size
# => 9223372036854775807

This returns a memory object that contains 4 bytes, but has what appears to be the correct bytes count.

If I try image.save(memory, :jpeg) I get the same result.

Problems creating an RGBQuad

white = FreeImage::RGBQuad.create(255, 255, 255)
white.to_s
=> "RGBQuad - Red: 0, Green: 0, Blue: 255, Alpha: 0"

I expected
=> "RGBQuad - Red: 255, Green: 255, Blue: 255, Alpha: 0"

free-image (0.6.2)

Document the ability to set custom JPEG quality level

Could you please document (perhaps under AbstractSource::Encoder) the fact you can pass any value between 1 and 100 in the flags parameter when saving as JPEG to set a custom quality level. I only found this out from extensive googling on the FreeImage library.

image.save("./thumbnail.jpg", :jpeg, 90)

Cheers

RangeError when calling Bitmap.open with IO object

I'm attempting to open an image from an IO stream (File object in this case), but I get the following error:

RangeError: integer 70353457099240 too big to convert to int' from /Users/tomwardrop/.rvm/gems/ruby-2.1.5/gems/free-image-0.6.2/lib/free-image/sources/io.rb:78:input_int32'

The cause is that a Ruby fixnum (which Ruby's Object#object_id returns) can be up to 62 bits, where as a C integer has a maximum length of 32 bits. I believe the following line needs to be changed to use a long instead of an int: https://github.com/cfis/free-image-ruby/blob/master/lib/free-image/sources/io.rb#L77

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.