Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[6.9.11-55] rounding have changed #129

Closed
remicollet opened this issue Jan 4, 2021 · 5 comments
Closed

[6.9.11-55] rounding have changed #129

remicollet opened this issue Jan 4, 2021 · 5 comments

Comments

@remicollet
Copy link
Contributor

With 16-bit colors, rgb(0,50%,0) return 32767 instead of 32768 in previous versions

See Imagick/imagick#373

@urban-warrior
Copy link
Member

How is the color value produced? What Q-level are you using? We get expected results with 6.9.11-55 Q16 from the command-line:

$ convert xc:'rgb(0,50%,0)' -compress none  xc.pnm

$ more xc.pnm
P3
1 1
65535
0 32768 0 

@remicollet
Copy link
Contributor Author

Really strange...

$ convert --version
Version: ImageMagick 6.9.11-55 Q16 x86_64 2021-01-04 https://imagemagick.org
Copyright: © 1999-2020 ImageMagick Studio LLC
License: https://imagemagick.org/script/license.php
Features: Cipher DPC Modules OpenMP(4.5) 
Delegates (built-in): bzlib cairo djvu fftw fontconfig freetype gslib gvc heic jbig jng jp2 jpeg lcms lqr ltdl lzma openexr pangocairo png ps raqm raw rsvg tiff webp wmf x xml zlib

$ convert xc:'rgb(0,50%,0)' -compress none  xc.pnm

$ cat xc.pnm 
P3
1 1
65535
0 32767 0 

@remicollet
Copy link
Contributor Author

Doesn't seems to be related to GCC version used (same issue on Fedora 31 with GCC 9 and Fedora 33 with GCC 10)

Can it be related to default RPM build options?
CFLAGS="${CFLAGS:--O2 -flto=auto -ffat-lto-objects -fexceptions -g -grecord-gcc-switches -pipe -Wall -Werror=format-security -Wp,-D_FORTIFY_SOURCE=2 -Wp,-D_GLIBCXX_ASSERTIONS -specs=/usr/lib/rpm/redhat/redhat-hardened-cc1 -fstack-protector-strong -specs=/usr/lib/rpm/redhat/redhat-annobin-cc1 -m64 -mtune=generic -fasynchronous-unwind-tables -fstack-clash-protection -fcf-protection}"

@urban-warrior
Copy link
Member

Its a floating-point precision issue. We'll have a patch shortly and a new release within a few days. Thanks for alerting us to this issue.

urban-warrior pushed a commit to ImageMagick/ImageMagick that referenced this issue Jan 5, 2021
urban-warrior pushed a commit to ImageMagick/ImageMagick that referenced this issue Jan 5, 2021
@remicollet
Copy link
Contributor Author

Seems fixed in 6.9.11-56

netbsd-srcmastr pushed a commit to NetBSD/pkgsrc that referenced this issue Jan 12, 2021
2021-01-09  7.0.10-57  <quetzlzacatenango@image...>
  * Release ImageMagick version 7.0.10-57 GIT revision 18218:d7a3d75ff:20210109

2021-01-08  7.0.10-57  <quetzlzacatenango@image...>
  * update automake/autoconf configuration files.
  * additional checks to prevent integer overflow.

2021-01-05  7.0.10-56  <quetzlzacatenango@image...>
  * Release ImageMagick version 7.0.10-56 GIT revision 18192:2fb74f026:20210105

2021-01-05  7.0.10-56  <quetzlzacatenango@image...>
  * Fix rounding error for CSS colors (reference
    ImageMagick/ImageMagick6#129).

2021-01-03  7.0.10-55  <quetzlzacatenango@image...>
  * Release ImageMagick version 7.0.10-55 GIT revision 18181:636ebf7ba:20210103

2021-01-04  7.0.10-55  <quetzlzacatenango@image...>
  * revert changes to the default max width/height of image.
bmwiedemann pushed a commit to bmwiedemann/openSUSE that referenced this issue Jan 20, 2021
https://build.opensuse.org/request/show/864042
by user pgajdos + dimstar_suse
- update to 7.0.10.58:
  * identify the convex hull and minimum bounding box attributes of an image
    with the -define identify:convex-hull=true define.
  * set the quality to 100 to produce lossless HEIC images (reference
    ImageMagick/ImageMagick#3116).
  * properly identify SVG images (reference
    ImageMagick/ImageMagick#3117).
  * duplicate operator: inverse range parameter working again (reference
    ImageMagick/ImageMagick#3113).
  * Fix rounding error for CSS colors on i686 (reference
    https://tracker.debian.org/pkg/imagemagick).
  * additional checks to prevent integer overflow.
  * Fix rounding error for CSS colors (reference
    ImageMagick/ImageMagick6#129). (forwarded
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Development

No branches or pull requests

2 participants