You may start from here: http://owl.phy.queensu.ca/~phil/exiftool/ or the GUI http://u88.n24.queensu.ca/~bogdan/KYPREO wrote: Fri Jun 29, 2018 12:02 am Excellent. Thanks I will have some images from my Samsung 9 which I know do not rotate correctly on vanilla phpBB 3.2.2
In my opinion, this would be the optimal solution to the problem.KYPREO wrote: Thu Jun 28, 2018 11:23 pmThe ideal fix for this would be to have rotate icon next to attachments or inline attachments in the preview window, allowing the user to see the orientiation error and fix it in the post itself.
Agreed, you should make an extension request. I’m not certain about optimal though, there may be better ideas turn up.
That would be the natural fallback for those imgs which don't have an exif 'Orientation' flag in the metadata.Andimp3 wrote: Fri Jun 29, 2018 6:14 amIn my opinion, this would be the optimal solution to the problem.KYPREO wrote: Thu Jun 28, 2018 11:23 pmThe ideal fix for this would be to have rotate icon next to attachments or inline attachments in the preview window, allowing the user to see the orientiation error and fix it in the post itself.
Great!lopoto wrote: Fri Jun 29, 2018 11:22 pm So far, he's working well ,sometimes the photos from the iphone were bad, now I checked a few photos and all were as it should be. So thx 3Di for you work .
-auto-orient
flag. Code: Select all
@passthru(escapeshellcmd($config['img_imagick']) . 'convert' . ((defined('PHP_OS') && preg_match('#^win#i', PHP_OS)) ? '.exe' : '') . ' -quality 85 -geometry ' . $new_width . 'x' . $new_height . ' "' . str_replace('\\', '/', $source) . '" "' . str_replace('\\', '/', $destination) . '"');
Code: Select all
@passthru(escapeshellcmd($config['img_imagick']) . 'convert' . ((defined('PHP_OS') && preg_match('#^win#i', PHP_OS)) ? '.exe' : '') . ' -auto-orient -quality 85 -geometry ' . $new_width . 'x' . $new_height . ' "' . str_replace('\\', '/', $source) . '" "' . str_replace('\\', '/', $destination) . '"');
Let me test it for you.
Mirror horizontal and rotate 270 CW
=< 256M
so to don't interfere with greater settings. Then providing a meaningful error handling for such cases. Is it using Imagemagick for manipulation? The reason i ask is I've found the thumbnails created using Imagemagick superior to GD.
I deal with the full size images client side with minor edit to phpbb/plupload/plupload.php however that would fail if the user does not have JS enabled. The image is already rotated by the time it gets posted and the edit for Imagemagick I posted above should only come into play if JS is disabled.The modification you posted is just for to create thumbnails, btw.
Code: Select all
'resize: {width: %d, height: %d, quality: 85, preserve_headers: false},',
Code: Select all
The destination IMG will be manipulated using memory resources, image rotation might fail because of needing much memory, in the code I put a ini_set max memory to 256M at function's runtime. Depending on server's settings though it could fail, in the next version that logic will be improved a bit, first checking if that memory limit is already set to =< 256M so to don't interfere with greater settings. Then providing a meaningful error handling for such cases.
This would be available for edits? That by itself would be reason enough for me to install it so i could easily fix the hundreds of older images as I come across them.The new feature Jquery/Ajax to rotate every img with no Exif metadata ['Orientation'] will be present as well.
As I previously saidthecoalman wrote: Mon Jul 02, 2018 11:59 am I deal with the full size images client side with minor edit to plupload/plupload.php however that would fail if the user does not have JS enabled. The image is already rotated by the time it gets posted and the edit for Imagemagick I posted above should only come into play if JS is disabled
and no need of JS, that's PHP.3Di wrote: Thu Jun 28, 2018 11:39 pm ... this extension uses an event which does the job before of that, where the image have to be posted/stored, still.
Code: Select all
/**
* Event to modify uploaded file before submit to the post
*
* @event core.modify_uploaded_file
* @var array filedata Array containing uploaded file data
* @var bool is_image Flag indicating if the file is an image
* @since 3.1.0-RC3
*/
$vars = array(
'filedata',
'is_image',
);
extract($this->phpbb_dispatcher->trigger_event('core.modify_uploaded_file', compact($vars)));
$this->file_data = $filedata;
unset($filedata);
// Check for attachment quota and free space
if (!$this->check_attach_quota() || !$this->check_disk_space())
{
return $this->file_data;
}
// Create Thumbnail
$this->create_thumbnail();
To be more precise, the image will be rotated prior of the nativethecoalman wrote: Mon Jul 02, 2018 11:59 am Is it using Imagemagick for manipulation? The reason i ask is I've found the thumbnails created using Imagemagick superior to GD.
create_thumbnail()
's execution (see above code, the last line), which will use ImageMagik if it is present (active), yes.You can change that value here https://github.com/3D-I/phpBB-Exif-Imag ... er.php#L85 - at the moment is hard-coded.thecoalman wrote: Mon Jul 02, 2018 11:59 am If I recall correctly when using GD for thumbnails for really large images of 12MP I may have had the memory set in the script to 512.
That's a bonus not really the reason for what this extension has been made for, but.. for any other questions/request like plupload.php and what not yet discussed/implemented here, pls consider to use the tracker located here https://github.com/3D-I/phpBB-Exif-Imag ... new/choose - so that I can keep tracks of all at a glance.thecoalman wrote: Mon Jul 02, 2018 11:59 amThis would be available for edits? That by itself would be reason enough for me to install it so i could easily fix the hundreds of older images as I come across them.The new feature Jquery/Ajax to rotate every img with no Exif metadata ['Orientation'] will be present as well.
Code: Select all
@passthru(escapeshellcmd($config['img_imagick']) . 'convert' . ((defined('PHP_OS') && preg_match('#^win#i', PHP_OS)) ? '.exe' : '') . ' -auto-orient -quality 85 -resize 600' . ' "' . str_replace('\\', '/', $source) . '" "' . str_replace('\\', '/', $destination) . '"');