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

Percentage -border in x dimension adds one pixel border in y dimension #2978

Closed
3 tasks done
tmont opened this issue Dec 13, 2020 · 4 comments
Closed
3 tasks done

Percentage -border in x dimension adds one pixel border in y dimension #2978

tmont opened this issue Dec 13, 2020 · 4 comments

Comments

@tmont
Copy link

tmont commented Dec 13, 2020

Prerequisites

  • I have written a descriptive issue title
  • I have verified that I am using the latest version of ImageMagick
  • I have searched open and closed issues to ensure it has not already been reported

Description

Specifying a percentage -border value (e.g. 10%) in the x dimension adds a one pixel border in the y dimension when a y-value is not specified (or zero). Using non-percentages works fine and does not add a border.

In the opposite direction (e.g. 0x10%) works fine and does not add a horizontal border.

Note that this is inside a Docker container for use as an AWS Lambda layer. Every other build I've tried has worked fine.

Still, this isn't the kind of issue I expected to run into, because it kind of just seems like a rounding error or something. I think perhaps this build is missing some core piece somehow?

Steps to Reproduce

Input (black square):

magick -size 100x100 xc:black input.png

input

magick input.png -bordercolor teal -border 10%x0 output.png

output

magick input.png -bordercolor teal -border 10%x0% output.png

output

System Configuration

  • ImageMagick version:
$ magick -version
Version: ImageMagick 7.0.10-48 Q16 x86_64 2020-12-13 https://imagemagick.org
Copyright: © 1999-2020 ImageMagick Studio LLC
License: https://imagemagick.org/script/license.php
Features: Cipher DPC HDRI 
Delegates (built-in): bzlib jng jp2 jpeg png tiff webp zlib
  • Environment (Operating system, version and so on):

Compiled inside this Docker container: https://github.com/serverlesspub/imagemagick-aws-lambda-2

It builds libopenjp2, libwebp, ligtiff, libjpeg, bzip2 and libpng from source.

Here are the package config flags:

PKG_CONFIG_PATH=$(CACHE_DIR)/lib/pkgconfig \
	./configure \
	CPPFLAGS=-I$(CACHE_DIR)/include \
	LDFLAGS=-L$(CACHE_DIR)/lib \
	--disable-dependency-tracking \
	--disable-shared \
	--enable-static \
	--prefix=$(TARGET_DIR) \
	--enable-delegate-build \
	--without-modules \
	--disable-docs \
	--without-magick-plus-plus \
	--without-perl \
	--without-x \
	--disable-openmp
  • Additional information:

The default version from the apt repository (at least the one on my host machine) works fine, as does the latest binary from imagemagick.org. It seems to only be this build inside the docker container.

Any guidance would be appreciated.

@tmont
Copy link
Author

tmont commented Dec 14, 2020

I thought it only occurred with the a zero-ed out y dimension, but it's the same issue with the x dimension as well.

magick input.png -bordercolor teal -border 0x10% output.png

output

@snibgo
Copy link

snibgo commented Dec 14, 2020

I confirm this bug with IM v6.9.9-50 and v7.0.8-64.

@urban-warrior
Copy link
Member

Thanks for the problem report. We can reproduce it and will have a patch to fix it in the GIT master branch @ https://github.com/ImageMagick/ImageMagick later today. The patch will be available in the beta releases of ImageMagick @ https://www.imagemagick.org/download/beta/ by sometime tomorrow.

urban-warrior pushed a commit to ImageMagick/ImageMagick6 that referenced this issue Dec 19, 2020
@tmont
Copy link
Author

tmont commented Dec 25, 2020

I downloaded and built ImageMagick 7.0.10-53 from source and this appears to be fixed.

Thanks!

@tmont tmont closed this as completed Dec 25, 2020
netbsd-srcmastr pushed a commit to NetBSD/pkgsrc that referenced this issue Jan 4, 2021
2020-12-27  7.0.10-54  <quetzlzacatenango@image...>
  * Release ImageMagick version 7.0.10-54 GIT revision 18...

2020-12-27  7.0.10-54  Dirk Lemstra <dirk@lem.....org>
  * replaced jxl coder with an implementation that uses the jpeg-xl reference
    library.
  * added -define trim:edges=(north,east,south,west) that can be used to
    trim a single or multiple edges.

2020-12-25  7.0.10-54  <quetzlzacatenango@image...>
  * enable reading of a certain grayscale TIFF image.
  * support HEIC depth masks (reference
    ImageMagick/ImageMagick#3040).
  * validate pixel cache offsets (reference
    https://bugs.chromium.org/p/oss-fuzz/issues/detail?id=29039).

2020-12-24  7.0.10-53  <quetzlzacatenango@image...>
  * Release ImageMagick version 7.0.10-53 GIT revision 18083:3b141f557:20201224

2020-12-20  7.0.10-53  <quetzlzacatenango@image...>
  * CSS colors no longer require commas.
  * eliminate possible arthimetic overflow (reference
    https://bugs.chromium.org/p/oss-fuzz/issues/detail?id=28849)
  * support display-p3, Adobe-98, and Pro-photo colorspaces
  * read/write 1024 colors Sixel images (reference
    ImageMagick/ImageMagick#3018).

2020-12-19  7.0.10-52  <quetzlzacatenango@image...>
  * Release ImageMagick version 7.0.10-52 GIT revision 18057:1f5bab30b:20201219

2020-12-19  7.0.10-52  <quetzlzacatenango@image...>
  * return alpha bytes with stream utility (reference
    ImageMagick/ImageMagick#2862).
  * percentage -border in x no longer adds one pixel border in y (reference
    ImageMagick/ImageMagick#2978).

2020-12-18  7.0.10-51  <quetzlzacatenango@image...>
  * Release ImageMagick version 7.0.10-51 GIT revision 18052:475508769:20201218

2020-12-17  7.0.10-51  <quetzlzacatenango@image...>
  * reduce time to identify PDF/PS/XPS/PCL image width/height (reference
    ImageMagick/ImageMagick#2993).

2020-12-16  7.0.10-50  <quetzlzacatenango@image...>
  * Release ImageMagick version 7.0.10-50 GIT revision 18046:83c162886:20201216

2020-12-15  7.0.10-50  <quetzlzacatenango@image...>
  * revert patch to ready gray alpha TIFF image.

2020-12-14  7.0.10-49  <quetzlzacatenango@image...>
  * Release ImageMagick version 7.0.10-49 GIT revision 18040:7976abf6e:20201214

2020-12-13  7.0.10-49  <quetzlzacatenango@image...>
  * correct previous patch to read planar RGB TIFF images.

2020-12-10  7.0.10-48  <quetzlzacatenango@image...>
  * Release ImageMagick version 7.0.10-48 GIT revision 18026:4646e5fd1:20201210

2020-12-09  7.0.10-48  <quetzlzacatenango@image...>
  * Repair unit test failures (reference
    ImageMagick/ImageMagick#2959).

2020-12-09  7.0.10-47  <quetzlzacatenango@image...>
  * Release ImageMagick version 7.0.10-47 GIT revision 18020:6f1ee6104:20201209

2020-12-06  7.0.10-47  <quetzlzacatenango@image...>
  * support YAML image format.
  * use generic TIFF read method for LZW-compressed strips (reference
    ImageMagick/ImageMagick#2935).
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

3 participants