I implemented this change to /phpbb/plupload/plupload.php (around line 269):
From
Code: Select all
'resize: {width: %d, height: %d, quality: 85},',
Code: Select all
'resize: {width: %d, height: %d, quality: 85,preserve_headers: false},',
Code: Select all
'resize: {width: %d, height: %d, quality: 85},',
Code: Select all
'resize: {width: %d, height: %d, quality: 85,preserve_headers: false},',
Probably yes. If you have some spare time please check it yourself and report.KYPREO wrote: Fri Nov 09, 2018 12:25 pm As noted in the other thread, the update to plupload v.2.3.6 didn't resolve image rotation for me. In the ACP, I have thumbnails turned off and max image dimensions to 1440x900. With the previous version of plupload that ships with phpBB (v.2.3.3), attachments wouldn't rotate and EXIF would be stripped. With new version of plupload, EXIF data is retained including orientation data. Within phpBB, the image won't rotate, but it will display correctly if you open the image in a new tab or image display application.
I'm thinking that because EXIF data is retained with new plupload, this extension might work even with images that are reduced in size (since the extension would actually have orientation flags to know how to rotate the image)?
This is what the event in use has to offer.wojtek64 wrote: Sun Dec 16, 2018 7:09 am First check exif tag of orientation in file, and load picture to memory only when modification is needed.
In actuall version, picture is loaded to memory for all JPG's!
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
*/
Code: Select all
if ($is_image)
{
/* Only JPEG supported so far */
if ( function_exists('exif_read_data') && ($filedata['mimetype'] == 'image/jpeg') )
{
$this->image_orient($dest_file);
}
else
{
return;
}
}
Code: Select all
protected function image_orient($dest_file)
{
$a_exif = @exif_read_data($dest_file);
if (isset($a_exif['Orientation']))
{
switch($a_exif['Orientation'])
{
/* Horizontal flip */
case 2:
/* Vertical flip */
case 4:
/* Vertical flip & 90° rotate clockwise */
case 5:
/* Horizontal flip & 90° rotate counter clockwise */
case 7:
$b_flip = true;
break;
default:
$b_flip = false;
break;
}
switch( $a_exif['Orientation'] )
{
/* 180° rotate */
case 3:
/* Vertical flip */
case 4:
$i_rotate = 180;
break;
/* Vertical flip & 90° rotate clockwise */
case 5:
/* 90° rotate clockwise */
case 8:
$i_rotate = 90;
break;
/* 90° rotate counter clockwise */
case 6:
/* Horizontal flip & 90° rotate counter clockwise */
case 7:
$i_rotate = -90;
break;
default:
$i_rotate = 0;
break;
}
if ($b_flip || $i_rotation) {
/* For some this may be of help */
@ini_set('memory_limit', '256M');
/* Only JPEG supported so far */
$orient_dest = imagecreatefromjpeg($dest_file);
if ($b_flip)
{
imageflip( $orient_dest, IMG_FLIP_HORIZONTAL );
}
if ($i_rotate)
{
$orient_dest = imagerotate($orient_dest, $i_rotate, 0);
}
/**
* Using 100 means double/triple the original filesize.
* Default it is 95 by installation.
*/
imagejpeg($orient_dest, $dest_file, (int) $this->config['threedi_exir_percent']);
/* Free memory */
imagedestroy($orient_dest);
}
}
}
I officially declare that this release is the only one that exists.Hervé wrote: Tue Jun 18, 2019 8:54 am Hi,
I downoaded the extension which seems to work.
Is there an official release ?
Will be raised to Beta soon.
Can`t find the extention 'exif'...Requirements:phpBB => 3.2.2
,PHP => 5.5
,PHP extension 'exif'
.
Ask your host.Bernd R. wrote: Sat Sep 21, 2019 1:11 pmCan`t find the extention 'exif'...Requirements:phpBB => 3.2.2
,PHP => 5.5
,PHP extension 'exif'
.