display -size not working

Questions and postings pertaining to the usage of ImageMagick regardless of the interface. This includes the command-line utilities, as well as the C and C++ APIs. Usage questions are like "How do I use ImageMagick to create drop shadows?".
Post Reply
steidley
Posts: 2
Joined: 2018-06-29T07:58:10-07:00
Authentication code: 1152

display -size not working

Post by steidley »

When I show an image using

Code: Select all

$ display -verbose IMG_0017.JPG
IMG_0017.JPG JPEG 3072x2048 3072x2048+0+0 8-bit sRGB 2.818MB 0.090u 0:00.220
This is far too large of an image for my display, so I tried to modify the options with

Code: Select all

$ display -size 1024x768 IMG_0017.JPG
The image displayed, but it did nothing to the geometry of the image. It was just as large as before.

So I ran the command again, this time using the debug option

Code: Select all

$ display -debug -size 1024x768 IMG_0017.JPG
display: unrecognized event type `-size' @ error/display.c/DisplayImageCommand/901.
Other statistics:

Code: Select all

$ which display
/usr/bin/display

$ display -version
Version: ImageMagick 6.8.9-9 Q16 x86_64 2018-06-11 http://www.imagemagick.org
Copyright: Copyright (C) 1999-2014 ImageMagick Studio LLC
Features: DPC Modules OpenMP
Delegates: bzlib cairo djvu fftw fontconfig freetype jbig jng jpeg lcms lqr ltdl lzma openexr pangocairo png rsvg tiff wmf x xml zlib

$ lsb_release -a
No LSB modules are available.
Distributor ID:	Ubuntu
Description:	Ubuntu 16.04.4 LTS
Release:	16.04
Codename:	xenial

$ sudo apt install imagemagick
Reading package lists... Done
Building dependency tree       
Reading state information... Done
imagemagick is already the newest version (8:6.8.9.9-7ubuntu5.11).
0 upgraded, 0 newly installed, 0 to remove and 4 not upgraded.
I know the current version of ImageMagick is at release 7 now, but still... it seems like this should work. Any thoughts?

Thanks!
David
User avatar
fmw42
Posts: 25562
Joined: 2007-07-02T17:14:51-07:00
Authentication code: 1152
Location: Sunnyvale, California, USA

Re: display -size not working

Post by fmw42 »

-size will not help. It specifies the size of a new image. You want to resize it. Try

Code: Select all

magick display -resize 1024x1024 IMG_0017.JPG
steidley
Posts: 2
Joined: 2018-06-29T07:58:10-07:00
Authentication code: 1152

Re: display -size not working

Post by steidley »

Ah! Perfect.

That is an interesting command. I like how it gives you a "best fit". For instance, I chose a picture that had a portrait orientation, set the resize to 1024x1024, and it made it as large as possible, while honoring as much of the input as it could.

David
Post Reply