Coder Social home page Coder Social logo

Comments (12)

chregu avatar chregu commented on August 26, 2024 1

And 0.9.2 is released with those fixes

from imagine-vips.

chregu avatar chregu commented on August 26, 2024

Do you have some basic example code?

from imagine-vips.

alexander-schranz avatar alexander-schranz commented on August 26, 2024

Following should be enough to reproduce it:

$imagine = new \Imagine\Vips\Imagine();
$image = $imagine->load('fox-skater.gif');
$image->layers()->coalesce();
Example `fox-skater.gif`

fox-skater

from imagine-vips.

chregu avatar chregu commented on August 26, 2024

Thanks, could reproduce.

Can you try this branch and see if it does what you expect?

https://github.com/rokka-io/imagine-vips/tree/fix-coalesce

from imagine-vips.

alexander-schranz avatar alexander-schranz commented on August 26, 2024

@chregu the result seems not to be correct. Its not longer animated. It seems like it did write the first layer on all other layers or something like that.

from imagine-vips.

alexander-schranz avatar alexander-schranz commented on August 26, 2024

@chregu for me it looks like the current vips implementation does coalesce on read if I use the following gif:

Rotating_earth_(large)

Which have different layers sizes (400, 280, 282, ...):

foreach ($image->layers() as $layer) {
     // Output using imagick will be here 400, 280, 282, ...
     // Output using vips will be here 400, 400, 400, ...
     echo $layer->getSize()->getWidth());
}

$image->layers()->coalesce();

foreach ($image->layers() as $layer) {
     echo $layer->getSize()->getWidth()); // will output for both adapters 400, 400, ...
}

Not sure maybe coalesce should do nothing in the vips implementation. But maybe somebody use coalesce on custom added layers so its maybe still needed but not sure what the correct way to implement it.

from imagine-vips.

chregu avatar chregu commented on August 26, 2024

Mmmh, strange that it's not animated, but you're right. vips does make all the frames the same size. I look closer into it hopefully today (regarding transparency and such)

from imagine-vips.

alexander-schranz avatar alexander-schranz commented on August 26, 2024

@chregu question out of topic do you know if there is something similiar in vips like the following in imagick to get the real memory usage:

$image->getImagick()->getResource(\Imagick::RESOURCETYPE_MEMORY);

from imagine-vips.

chregu avatar chregu commented on August 26, 2024

vips memory management is a little bit "complicated" due to the way it works (which also makes it much less memory hungry than imagemagick). But the best is to ask the libvips author at https://github.com/libvips/libvips (just make an issue), he's very helpful and responsive

from imagine-vips.

chregu avatar chregu commented on August 26, 2024

On another topic, I improved the whole coalesce function. It's almost noop if you load a gif with vips. It only does actual coalesce if you add manually frames with a different size.

from imagine-vips.

chregu avatar chregu commented on August 26, 2024

So, should be good enough now. See #9 for the actual PR

from imagine-vips.

alexander-schranz avatar alexander-schranz commented on August 26, 2024

@chregu Thank you for the great support!

from imagine-vips.

Related Issues (18)

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.