Skip to content

Commit c398e2d

Browse files
authored
Update functions.image.php
Add -auto-orient switch to image magick thumbnail command otherwise, thumbnails could get created with the incorrect orientation if the EXIF tag in the file is specifying a different one. This happens with images taken with mobile devices. The browser automatically read the EXIF tag and views the original image correctly, but without this switch, the generated thumbnails would could show up incorrectly.
1 parent 7602510 commit c398e2d

1 file changed

Lines changed: 1 addition & 1 deletion

File tree

include/functions.image.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -144,7 +144,7 @@ function newbbCreateThumbnail($source, $thumb_width)
144144
$new_file_im = @escapeshellarg($new_file);
145145
}
146146
$path = empty($GLOBALS['xoopsModuleConfig']['path_magick']) ? '' : $GLOBALS['xoopsModuleConfig']['path_magick'] . '/';
147-
$magick_command = $path . 'convert -quality 85 -antialias -sample ' . $newWidth . 'x' . $newHeight . ' ' . $src_file_im . ' +profile "*" ' . str_replace('\\', '/', $new_file_im) . '';
147+
$magick_command = $path . 'convert -auto-orient -quality 85 -antialias -sample ' . $newWidth . 'x' . $newHeight . ' ' . $src_file_im . ' +profile "*" ' . str_replace('\\', '/', $new_file_im) . '';
148148

149149
@passthru($magick_command);
150150
if (file_exists($new_file)) {

0 commit comments

Comments
 (0)