[php-maint] Bug#853879: php5: exif_thumbnail fails on some valid jpg files

Pirity Tamas Gabor ptg at apaczai.elte.hu
Wed Feb 1 18:10:06 UTC 2017


Package: php5
Version: 5.4.45-0+deb7u6
Severity: normal

Dear Maintainer,

-- System Information:
Debian Release: 7.11
  APT prefers oldstable-updates
  APT policy: (500, 'oldstable-updates'), (500, 'oldstable')
Architecture: amd64 (x86_64)

Kernel: Linux 3.2.0-4-amd64 (SMP w/2 CPU cores)
Locale: LANG=hu_HU.utf8, LC_CTYPE=hu_HU.utf8 (charmap=UTF-8)
Shell: /bin/sh linked to /bin/dash

Versions of packages php5 depends on:
ii  libapache2-mod-php5  5.4.45-0+deb7u6
ii  php5-cgi             5.4.45-0+deb7u6
ii  php5-common          5.4.45-0+deb7u6
-- no debconf information

I work on a gallery on my personal homepage, and want to get thumbnails
from the pictures with php_thumbnail() function. This works on some
jpg files, but doesn't work on others. The working and failing files
are correct, contain 160x120 thumbnail.

The script:

$ cat ttt.php
<?php
$file=$argv[1];
if (file_exists($file))
{
  if (exif_imagetype($file)==IMAGETYPE_JPEG)
  {
    $image=exif_thumbnail($file, $width, $height, $type);
    #header('Content-type: '.image_type_to_mime_type($type));
    #echo $image;
    printf("%d\n%d\n%d\n", $width, $height, $type);
  }
}
?>
$ php ttt.php 20150901_092323.jpg
0
0
0
$ php ttt.php 20100922_094342.jpg
160
120
2
$

Both files are valid jpg pictures, with 160x120 thumbnail, as exiv2 shows
and extract the thumbnail from both.

$ exiv2 20150901_092323.jpg 20100922_094342.jpg |grep Thumb
20150901_092323.jpg  Thumbnail       : image/jpeg, 5667 Bytes
20100922_094342.jpg  Thumbnail       : image/jpeg, 8978 Bytes

The script works on jessia-based machines, and i try two fresh wheezy-based
machines, neither works.

Relevant files are here: http://ptg.apaczai.elte.hu/php-bug

Sincerelly,

Pirity Tamás
-- 
PTG



More information about the pkg-php-maint mailing list