GithubHelp home page GithubHelp logo

Resize Bug in GIF about converjon HOT 7 CLOSED

trendfischer avatar trendfischer commented on August 15, 2024
Resize Bug in GIF

from converjon.

Comments (7)

selfawaresoup avatar selfawaresoup commented on August 15, 2024

I can't reproduce this behaviour but I'm running slightly different versions of ImageMagick and Exiftool:

  • ImageMagick 6.8.8-9
  • Exiftool 9.54

My first guess would be a bug in ImageMagick that is fixed in this newer version.

from converjon.

trendfischer avatar trendfischer commented on August 15, 2024

Do we have an example ImageMagick-Command or can I log converjon commands, so that I can verify, ImageMagick is the problem?

from converjon.

selfawaresoup avatar selfawaresoup commented on August 15, 2024

The commands that converjon uses are logged when the "debug" option is set to truein the configs.

Here's the logged command for this GIF:

convert ./cache/source/localhost:8001/test.gif -crop 74x99+47+0 -resize 125x166! gif:./cache/target/localhost:8001/test.gif/905ebb9f63bf818765f4391885b0a68574977a49c9edbebea3627ad1e9893717.gif

I also did reproduce this problem with the later version of imagemagick. I was accidentally converting to JPEG before where the problem does not occur. It does only occur when converting to GIF, regardless of the source format.

from converjon.

selfawaresoup avatar selfawaresoup commented on August 15, 2024
$ identify test.gif
test.gif GIF 169x99 169x99+0+0 8-bit sRGB 64c 1.9KB 0.000u 0:00.000
$ convert test.gif -crop 74x99+47+0 -resize 125x166! gif:out.gif
$ identify out.gif
out.gif GIF 125x166 285x166+79+0 8-bit sRGB 256c 4.97KB 0.000u 0:00.000

There seems so be additional metadata in the output GIF that contains different dimensions for the image.

from converjon.

neffets avatar neffets commented on August 15, 2024

Same error on Suse SLES-11 SP3

error occurs while crop without resize:

$ identify test.gif
test.gif GIF 169x99 169x99+0+0 8-bit PseudoClass 64c 1.85kb
$ convert test.gif -crop 74x99+47+0 gif:crop.gif
$ identify crop.gif
crop.gif GIF 74x99 169x99+47+0 8-bit PseudoClass 64c 1.16kb
$ file crop.gif
crop.gif: GIF image data, version 89a, 169 x 99

from converjon.

neffets avatar neffets commented on August 15, 2024

There is an additional option for ImageMagick: "+repage" http://www.imagemagick.org/script/command-line-options.php#repage

That solves the GIF-problem:

$ identify test.gif
test.gif GIF 169x99 169x99+0+0 8-bit sRGB 64c 1.9KB 0.000u 0:00.000
$ convert test.gif -crop 74x99+47+0 +repage gif:crop.gif
$ identify crop.gif
crop.gif GIF 74x99 74x99+0+0 8-bit sRGB 64c 1.19KB 0.000u 0:00.000
$ file crop.gif
crop.gif: GIF image data, version 89a, 74 x 99

and

$ convert test.gif -crop 74x99+47+0 +repage -resize 125x166! gif:out.gif
$ identify out.gif
out.gif GIF 125x166 125x166+0+0 8-bit sRGB 256c 5.05KB 0.000u 0:00.000
$ file out.gif
out.gif: GIF image data, version 89a, 125 x 166

Please add this additional option to converjon for gif-conversion.

from converjon.

selfawaresoup avatar selfawaresoup commented on August 15, 2024
--- a/lib/converter.js
+++ b/lib/converter.js
@@ -104,6 +104,10 @@ var getConvertArgs = function(sourceFile, targetFile, options) {
                 args.push("-border", cropping.paddingX+"x"+cropping.paddingY);
         }

+    if (to == "gif") {
+        args.push("+repage");
+    }
+
         if (options.width && options.height) {
                 args.push("-resize", options.width+"x"+options.height+"!");
         } else if (options.width) {

This is a fix for 1.8.1, it should be included into 2.0.0.

from converjon.

Related Issues (20)

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.