Advertisement:

Navigation

SMF Mod Site

Mod Name:
Automatic Attachment Rotation
Created By:
dougiefresh
Type:
New Feature
First Created:
February 24, 2016, 10:24:14 AM
Last Modified:
October 09, 2017, 09:02:48 AM
Latest Version:
3.8
Compatible With:
2.0.11, 2.0.12, 2.0.13, 2.0.14, 2.1 Beta 3
Total Downloads:
401

Download this mod

Automatic_Attachment_Rotation_v3.8.zip (31kB) [5]
Manual Install Instructions for SMF


Below are some preview images of what the mod looks like when being used

Description:


AUTOMATIC ATTACHMENT ROTATION v3.8
By Dougiefresh -> Link to Mod


Introduction
This mod allows the automatic rotation and/or flipping of images ONLY IF the EXIF information contained within (if such exists) indicates that such processing is required in order to show the picture upright.

NOTE: SMF contains an option called Re-encode potentially dangerous image attachments, which is turned on by default.  This re-encoding removes the orientation information from attachments (amongst other things), which means that attachments uploaded prior to this mod being installed will NOT be able to rotated properly, as the EXIF information is missing from the re-encoded attachment file!

Admin Changes
In Admin => Forum => Attachments and Avatars:
o Browse Files: There is a new column for image rotation.  Note that this column isn't shown when there are no images in the list.
o File Maintenance: There is a new section with a button to clear the orientation flags in the database.

Post Screen Changes
Beside each attachment, there is a dropbox for image rotation, listing the options in the following section.

Manual Rotation Options
o No Change
o Horizontal Flip
o Rotate 180 degrees
o Vertical Flip
o Vertical Flip, Rotate 270 degrees clockwise. (90 degrees counter-clockwise)
o Rotate 270 degrees clockwise. (90 degrees counter-clockwise)
o Horizontal Flip, Rotate 270 degrees clockwise. (90 degrees counter-clockwise)
o Rotate 90 degrees clockwise.

Compatibility Notes
This mod was tested on SMF 2.0.12 and 2.1 Beta 3, but should work on SMF 2.0 and up.  SMF 1.x is not and will not be supported.

Special Credit
This mod relies on the phpExifRW class, which is licensed under the GNU Lesser General Public License, in order to read the EXIF information from image files.  This class makes the requirement of having EXIF support built-in, which some servers do not have, not important to the task of successfully pulling the orientation out of the image file.  The exifReader.inc file was renamed to Class-exifReader.php in order to name the file in accordance with the naming convention of SMF and included in this mod.

Test images with EXIF orientation values embedded in them are available at Galloway.me.uk and at the Image Orientation thread over at the ElkArte forum.

Changelog
The changelog has been removed and can be seen at XPtsp.com.

License
Quote
Copyright (c) 2016 - 2017, Douglas Orend
All rights reserved.

Redistribution and use in source and binary forms, with or without modification, are permitted provided that the following conditions are met:

1. Redistributions of source code must retain the above copyright notice, this list of conditions and the following disclaimer.

2. Redistributions in binary form must reproduce the above copyright notice, this list of conditions and the following disclaimer in the documentation and/or other materials provided with the distribution.

THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.