Attached JPG not opened in PHP 7.2

Post any defects you find in the released or beta versions of the ImageMagick software here. Include the ImageMagick version, OS, and any command-line required to reproduce the problem. Got a patch for a bug? Post it here.
Post Reply
JPGMike
Posts: 3
Joined: 2019-12-05T09:13:04-07:00
Authentication code: 1152

Attached JPG not opened in PHP 7.2

Post by JPGMike »

Hi...,

I use ImageMagick in PHP 7.2:
https://www.php.net/manual/en/book.imagick.php

All my files are opened, but this jpg doesn't:
https://www.dropbox.com/s/kdqoe01crudu6 ... 1.jpg?dl=0

$imagick = new Imagick('test1.jpg');

What I am doing wrong?

Thanks

Mike

snibgo
Posts: 12922
Joined: 2010-01-23T23:01:33-07:00
Authentication code: 1151
Location: England, UK

Re: Attached JPG not opened in PHP 7.2

Post by snibgo »

If you use "magick identify" on that file, you will see that it isn't a jpg file, but webp.
snibgo's IM pages: im.snibgo.com

JPGMike
Posts: 3
Joined: 2019-12-05T09:13:04-07:00
Authentication code: 1152

Re: Attached JPG not opened in PHP 7.2

Post by JPGMike »

Thank you, good to know.

I can't load this file with Imagick, so I can't use

$identity = $imagick->identifyImage();

What to do in PHP?

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

Re: Attached JPG not opened in PHP 7.2

Post by fmw42 »

When I try to download and open your file, I get a message that the file cannot be opened and may be damaged.

JPGMike
Posts: 3
Joined: 2019-12-05T09:13:04-07:00
Authentication code: 1152

Re: Attached JPG not opened in PHP 7.2

Post by JPGMike »

OK, now this works for me. I check first the mime_content_type with

$mime_content_type = mime_content_type( 'test1.jpg' );

Post Reply