Skip to content

Not printing crop position #8098

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

Open
niklasravnsborg opened this issue Apr 13, 2025 · 1 comment
Open

Not printing crop position #8098

niklasravnsborg opened this issue Apr 13, 2025 · 1 comment

Comments

@niklasravnsborg
Copy link

niklasravnsborg commented Apr 13, 2025

ImageMagick version

7.1.1-47

Operating system

Linux

Operating system, version and so on

macOs

Description

I want to use the following command to get the crop size and offset of my image (original size 924 × 614). It shows a cropped image size but it always only shows +0+0 as the offset which can't be correct.

➜  magick public/myimage.png -fuzz 20% -format "%@" -trim info:
865x405+0+0

Some other commands show more information:

➜  magick public/myimage.png -fuzz 20% -trim info:
public/myimage.png PNG 865x405 924x614+39+169 8-bit TrueColor sRGB 104002B 0.000u 0:00.000
➜  magick public/myimage.png info:
public/myimage.png PNG 924x614 924x614+0+0 8-bit TrueColor sRGB 104002B 0.010u 0:00.000

Seams not like intended behavior to me. I would expect the first command to return 865x405+39+169...

Steps to Reproduce

Run the commands from above on the image.

Images

Image

@niklasravnsborg niklasravnsborg changed the title Not showing crop position Not printing crop position Apr 13, 2025
@fmw42
Copy link

fmw42 commented Apr 13, 2025

You don't use both %@ and -trim in the same command if you only want the information

magick public/myimage.png -fuzz 20% -format "%@" info:

If you want the information and trim the image with an output, then

magick public/myimage.png -fuzz 20% -format "%@" -write info: -trim +repage result.png

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