1

Imagick::getImageInterlaceScheme is deprecated but I can't find a way to replace it in the code. I tried with Imagick::getInterlaceSchema but it returns different values for the same image.

Does anybody know what would be the proper way to replace this function calls?

Thank you!

EDIT: I also asked the maintainers directly - it turns out it will be un-deprecated in the next release: https://github.com/Imagick/imagick/issues/455

  • Where did you see that `Imagick::getImageInterlaceScheme()` is deprecated? It doesn't say anything about it [in the manual](https://www.php.net/manual/en/imagick.getimageinterlacescheme.php)? Does it throw a deprecation warning? – M. Eriksson Sep 07 '21 at 18:47
  • 1
    Yes, it doesn't say anything about it in the manual, but throws deprecation warning: `PHP Deprecated: Imagick::getImageInterlaceScheme method is deprecated and it's use should be avoided` – Aleksandar Jakovljevic Sep 08 '21 at 07:20
  • I also asked the maintainers directly - it turns out it will be un-deprecated in the next release: https://github.com/Imagick/imagick/issues/455 – Aleksandar Jakovljevic Sep 11 '21 at 09:30

1 Answers1

2

Not sure where you got that information, nor am I sure exactly how desperate you are, but if your JPEG is progressive/interlaced it will almost certainly contain a SOF2 marker of 0xff 0xc2. If it is not interlaced it will certainly not contain that.

See p32 here.

For testing, you can make a regular JPEG with ImageMagick in Terminal like this:

magick -size 64x64 xc:black regular.jpg

And an interlaced one like this:

magick -size 64x64 xc:black -interlace line interlaced.jpg
Mark Setchell
  • 191,897
  • 31
  • 273
  • 432