Line 43 of image-rotation-fixer.php should be:
$filename = end( $sourceFile );
instead of
$filename = $sourceFile[5];
Why? Here is what $sourceFile
looks like when running on my Windows machine:
[12-Sep-2016 14:23:32 UTC] Array
(
[0] => C:\MAMP\htdocs\test-site
[1] =>
[2] => wp-content
[3] => uploads
[4] => 04.jpeg
)
and here is the error I get:
]]>[12-Sep-2016 14:23:32 UTC] PHP Notice: Undefined offset: 5 in C:\MAMP\htdocs\test-site\wp-content\plugins\image-rotation-fixer\image-rotation-fixer.php on line 47
Hi,
I am using your plugin and when uploading images I am getting these errors:
Warning: imagejpeg() expects parameter 1 to be resource, boolean given in/home/tottewrx/public_html/wp-content/plugins/image-rotation-fixer/image-rotation-fixer.php on line 89
Warning: imagejpeg() expects parameter 1 to be resource, boolean given in/home/tottewrx/public_html/wp-content/plugins/image-rotation-fixer/image-rotation-fixer.php on line 89
Warning: imagejpeg() expects parameter 1 to be resource, boolean given in/home/tottewrx/public_html/wp-content/plugins/image-rotation-fixer/image-rotation-fixer.php on line 89
Warning: imagecreatefromjpeg(): gd-jpeg, libjpeg: recoverable error: Invalid SOS parameters for sequential JPEG in/home/tottewrx/public_html/wp-content/plugins/image-rotation-fixer/image-rotation-fixer.php on line 52
Warning: imagecreatefromjpeg(): ‘/home/tottewrx/public_html//wp-content/uploads/2016/06/2016-06-22_576a4a4a7352d_20160521_191450.jpg’ is not a valid JPEG file in/home/tottewrx/public_html/wp-content/plugins/image-rotation-fixer/image-rotation-fixer.php on line 52
Warning: imagecopyresampled() expects parameter 2 to be resource, boolean given in /home/tottewrx/public_html/wp-content/plugins/image-rotation-fixer/image-rotation-fixer.php on line 56
Warning: imagejpeg() expects parameter 1 to be resource, boolean given in/home/tottewrx/public_html/wp-content/plugins/image-rotation-fixer/image-rotation-fixer.php on line 89
How can I fix this?
Thanks!
]]>It’s a great idea, but unfortunately it’s not working on the newest WP version.
]]>I’m having a problem with the rotation of portrait images. The images look fine when I first upload them and when I’m still editing the post. However, once I publish the post and visit the post, it’s been incorrectly flipped to landscape orientation. When I go back to post editor, everything looks fine again.
This is a recent problem. Just a few days ago, all the portrait pictures looked fine. Also, it only seems to be a problem in some web browsers. On my phone browser and google chrome, it’s a problem. In microsoft edge, everything looks fine. I’ve tried using the “image rotation fixer” plugin, but the problem persists. I’ve tried replacing the images with a renamed version, but still no luck. Anyone have any ideas on how to fix this? I’ve included a link to screenshots of the problem below.
The website is: danielfreid.com
I am running WordPress 4.2.7 with php version 5.2.17 and have the php module exif enabled, see below:`
EXIF Support enabled
EXIF Version 1.4 $Id: exif.c 293036 2010-01-03 09:23:27Z sebastian $
Supported EXIF Version 0220
Supported filetypes JPEG,TIFF
Despite this the image rotation fixer plugin is not working on this site. The website is in a subdirectory (public_html¥website), but I am not sure if this is a contributing factor. Can anyone suggest a fix or solution? Many thanks.
]]>The following error occurs directly after I upload a file.
An error occurred in the upload. Please try again later.
If I disable the plugin, the problem disappears.
EXIF in PHP is enabled:
EXIF Support enabled
EXIF Version 1.4 $Id: a0425de51ec3270d01522bf62d41bfe78893f78d $
Supported EXIF Version 0220
Supported filetypes JPEG,TIFF
Im running PHP v5.6.15 on Apache
PHP Memory Limit 256.0 MiB
PHP Max Upload Size 128.0 MiB
PHP Max Script Execute Time 600s
Looking at the post response I get the following:
Fatal error: Out of memory (allocated 89915392) (tried to allocate 16000 bytes) in /homepages/0/d84115947/htdocs/myzeit/wordpress/wp-content/plugins/image-rotation-fixer/image-rotation-fixer.php on line 56
The php memory_limit is set to 256M!
Please could you help?
]]>Hello,
while uploading a picture (it’s a panoramic pic from a mobile phone) this error prevent the picture to be uploaded:
Fatal error: Allowed memory size of 268435456 bytes exhausted (tried to allocate 35580 bytes)
it happens several times, always with pamoramic pictures (from an android Nexus 5)
there is a workaround that doesn’t suppose to disable the plugin, update the picture, rotate by hand and than activate the plugin back?
some kind of exception management that if there is memory error loads anyway the pictures and issues a warning “the picture abcd.jpg has not been rotated”
thank you very much!
beside this the plugin runs great, better than a looot of image manager around the web that are not able to handle the exif information of pictures!
]]>This plugin immediately fixed my problem of uploading portrait orientation photos onto WordPress. With this plugin, the portrait photos would upload correctly onto WordPress media. However, I tried with a new post today and it stopped working. All the portrait photos are being uploaded with landscape orientation (the same problem I had before the plugin). Is anyone else experiencing this?
]]>Hi,
Thanks for this great plugin! Could you add the mime type ‘image/jpg’ to the check on line 32?
Something like:
if ( ‘image/jpeg’ == $attachment->post_mime_type || ‘image/jpg’ == $attachment->post_mime_type ) {
Thanks!
]]>Hello,
I tried using this plugin under WP 4.2.2, but it looks like when the plugin updates the rotated image metadata, it does not generate (or removes) the set of large, medium, thumbnail or other custom sized images that a lot of themes and plugins rely on for displaying galleries and such, so it looks like the image is missing.
I am not sure if it needs to use “maybe_generate_attachment_meta” or what is happening that the image sizes are not being generated.
Thanks
]]>Warning: imagejpeg() expects parameter 1 to be resource, boolean given in /home/fiycnet/public_html/wp-content/plugins/image-rotation-fixer/image-rotation-fixer.php on line 89
380
Hi there,
I have been trying to get this to work with BuddyPress and rtMedia, both the latest version with no luck. Any ideas on why this might be the case? The best answer I can come up with is because of rtMedia, the media files don’t upload to the standard WP media library.
Would be awesome if this could work with both the these plugins. ??
Regards,
~ Daniel
Fatal error: Call to undefined function exif_read_data() in …/wp-content/plugins/image-rotation-fixer/image-rotation-fixer.php on line 58
Since WordPress doesn’t respect EXIF rotation, this plug is ESSENTIAL for anybody uploading a lot of images. Hope it gets fixed soon.
]]>Since I’ve upgraded to WordPress v4.0, I get an error message each time I try to upload a photo taken on my Samsung S4 Mini (Android 4.2.2) camera phone:
An error occurred in the upload, please try again later
Deactivating the plugin resolves this upload error problem.
]]>Gives an http error when trying to upload a jpg via the media uploader with WP 4.0.
]]>error when uploading with WP 3.9
]]>Thanks for your plugin it works almost as I hoped. But unfortunately there is no exif information in the file after the rotate. Is there a possibility that the plugin could readd the exif data to the rotated image?
]]>PHP issues a notification when uploading a picture that doesn’t have the Orientation EXIF data set. Adding a ?isset($exif[‘Orientation’]))? check starting at line 60 and ending it right after the switch{} statement fixes it.
The notification “stops” my upload so I have to close the upload window, reopen it and click the “gallery” tab to use the image.
https://www.ads-software.com/extend/plugins/image-rotation-fixer/
]]>I shoot a 5d2. I have a script that uses ImageMagik and exiftool to extract the jpg out of the RAW container, resize it, then finally stuff the EXIF back into the jpg after the conversion.
The piwigo.org software is able to read this EXIF and rotate images accordingly in the same environment I have WP running, so I know it’s not a limitation of PHP or any available libraries. Additionally, digikam, geeqie and gwenview each render the images properly with respect to the EXIF.
After installing this plugin in WP 3.4.1, I uploaded some sample images to confirm the plugin works:
Media > Add New > multifile uploader
The images appeared in my library, but they were not rotated.
I disabled all plugins EXCEPT the IRF plugin and activated the 2011 theme. Subsequent images were still not rotated correctly.
Here is the EXIF from a sample image that did not rotate as expected:
ExifTool Version Number : 8.78
File Name : IMG_6379.jpg
Directory : .
File Size : 331 kB
File Modification Date/Time : 2012:07:15 20:04:53-07:00
File Permissions : rw-r--r--
File Type : JPEG
MIME Type : image/jpeg
JFIF Version : 1.01
Exif Byte Order : Little-endian (Intel, II)
Make : Canon
Camera Model Name : Canon EOS 5D Mark II
Orientation : Rotate 270 CW
X Resolution : 72
Y Resolution : 72
Resolution Unit : inches
Modify Date : 2012:07:15 16:44:59
Artist :
Y Cb Cr Positioning : Centered
Copyright :
Exposure Time : 1/200
F Number : 3.5
Exposure Program : Manual
ISO : 100
Exif Version : 0221
Date/Time Original : 2012:07:15 16:44:59
Create Date : 2012:07:15 16:44:59
Components Configuration : Y, Cb, Cr, -
Shutter Speed Value : 1/197
Aperture Value : 3.5
Flash : Off, Did not fire
Focal Length : 38.0 mm
Macro Mode : Normal
Self Timer : Off
Quality : RAW
Canon Flash Mode : Off
Continuous Drive : Single
Focus Mode : One-shot AF
Record Mode : CR2+JPEG
Canon Image Size : Large
Easy Mode : Manual
Digital Zoom : None
Contrast : Normal
Saturation : Normal
Metering Mode : Spot
Focus Range : Not Known
Canon Exposure Mode : Manual
Lens Type : Canon EF 28-70mm f/2.8L or Sigma or Tamron Lens
Long Focal : 75 mm
Short Focal : 28 mm
Focal Units : 1/mm
Max Aperture : 2.8
Min Aperture : 32
Flash Activity : 0
Flash Bits : (none)
Zoom Source Width : 0
Zoom Target Width : 0
Manual Flash Output : n/a
Color Tone : Normal
SRAW Quality : n/a
Auto ISO : 100
Base ISO : 100
Measured EV : 9.50
Target Aperture : 3.6
Target Exposure Time : 1/203
Exposure Compensation : 0
White Balance : Custom
Slow Shutter : None
Shot Number In Continuous Burst : 0
Optical Zoom Code : n/a
Camera Temperature : 24 C
Flash Guide Number : 0
Flash Exposure Compensation : 0
Auto Exposure Bracketing : Off
AEB Bracket Value : 0
Control Mode : Camera Local Control
Measured EV 2 : 11.75
Bulb Duration : 0
Camera Type : EOS High-end
ND Filter : n/a
Canon Image Type : Canon EOS 5D Mark II
Canon Firmware Version : Firmware Version 2.1.2
Owner Name :
Serial Number : 4252101716
Flash Metering Mode : Off
Camera Orientation : Rotate 270 CW
Focus Distance Upper : 0 m
Focus Distance Lower : 0 m
Firmware Version : 2.1.2
File Index : 6379
Directory Index : 100
Contrast Standard : 0
Sharpness Standard : 3
Saturation Standard : 0
Color Tone Standard : 0
Contrast Portrait : 0
Sharpness Portrait : 2
Saturation Portrait : 0
Color Tone Portrait : 0
Contrast Landscape : 0
Sharpness Landscape : 4
Saturation Landscape : 0
Color Tone Landscape : 0
Contrast Neutral : 0
Sharpness Neutral : 0
Saturation Neutral : 0
Color Tone Neutral : 0
Contrast Faithful : 0
Sharpness Faithful : 0
Saturation Faithful : 0
Color Tone Faithful : 0
Contrast Monochrome : 0
Sharpness Monochrome : 3
Filter Effect Monochrome : None
Toning Effect Monochrome : None
Contrast User Def 1 : 0
Sharpness User Def 1 : 3
Saturation User Def 1 : 0
Color Tone User Def 1 : 0
Filter Effect User Def 1 : None
Toning Effect User Def 1 : None
Contrast User Def 2 : 0
Sharpness User Def 2 : 3
Saturation User Def 2 : 0
Color Tone User Def 2 : 0
Filter Effect User Def 2 : None
Toning Effect User Def 2 : None
Contrast User Def 3 : 0
Sharpness User Def 3 : 3
Saturation User Def 3 : 0
Color Tone User Def 3 : 0
Filter Effect User Def 3 : None
Toning Effect User Def 3 : None
User Def 1 Picture Style : Standard
User Def 2 Picture Style : Standard
User Def 3 Picture Style : Standard
Canon Model ID : EOS 5D Mark II
Thumbnail Image Valid Area : 0 159 7 112
Serial Number Format : Format 2
AF Area Mode : Single-point AF
Num AF Points : 9
Valid AF Points : 9
Canon Image Width : 5616
Canon Image Height : 3744
AF Image Width : 5616
AF Image Height : 3744
AF Area Widths : 84 84 101 84 84 84 101 84 123
AF Area Heights : 101 101 74 101 101 101 74 101 131
AF Area X Positions : -1173 -561 0 561 1173 561 0 -561 0
AF Area Y Positions : 0 280 501 280 0 -280 -501 -280 0
AF Points In Focus : (none)
AF Points Selected : 8
Original Decision Data Offset : 0
Bracket Mode : Off
Bracket Value : 0
Bracket Shot Number : 0
Raw Jpg Size : Large
Long Exposure Noise Reduction 2 : Off
WB Bracket Mode : Off
WB Bracket Value AB : 0
WB Bracket Value GM : 0
Live View Shooting : Off
Flash Exposure Lock : Off
Lens Model : 28-75mm
Internal Serial Number :
Dust Removal Data : (Binary data 1024 bytes, use -b option to extract)
Crop Left Margin : 0
Crop Right Margin : 0
Crop Top Margin : 0
Crop Bottom Margin : 0
Exposure Level Increments : 1/3 Stop
ISO Speed Increments : 1/3 Stop
ISO Expansion : On
AEB Auto Cancel : On
AEB Sequence : -,0,+
Safety Shift : Enable (Tv/Av)
Flash Sync Speed Av : 1/200-1/60 Auto
Long Exposure Noise Reduction : Off
High ISO Noise Reduction : Standard
Highlight Tone Priority : Disable
Auto Lighting Optimizer : Disable
Lens Drive No AF : Focus search on
Lens AF Stop Button : AF stop
AF Point Selection Method : Normal
Superimposed Display : On
AF Assist Beam : Emits
Mirror Lockup : Disable
AF Point Area Expansion : Disable
AF Microadjustment : Disable; 0; 0; 0; 0
Shutter Button AF On Button : AE lock/Metering + AF start
AF On AE Lock Button Switch : Enable
Set Button When Shooting : Image playback
Dial Direction Tv Av : Normal
Focusing Screen : Eg-A
Add Original Decision Data : Off
Assign Func Button : LCD brightness
Aspect Ratio : 3:2
Cropped Image Width : 5616
Cropped Image Height : 3744
Tone Curve : Standard
Sharpness : 0
Sharpness Frequency : n/a
Sensor Red Level : 0
Sensor Blue Level : 0
White Balance Red : 0
White Balance Blue : 0
Color Temperature : 6200
Picture Style : Neutral
Digital Gain : 0
WB Shift AB : 0
WB Shift GM : 0
Measured RGGB : 172 1024 1024 1540
VRD Offset : 0
Sensor Width : 5792
Sensor Height : 3804
Sensor Left Border : 168
Sensor Top Border : 56
Sensor Right Border : 5783
Sensor Bottom Border : 3799
Black Mask Left Border : 0
Black Mask Top Border : 0
Black Mask Right Border : 0
Black Mask Bottom Border : 0
Color Data Version : 6 (50D/5DmkII)
WB RGGB Levels As Shot : 2411 1024 1024 1450
Color Temp As Shot : 6745
WB RGGB Levels Auto : 2394 1024 1024 1517
Color Temp Auto : 6363
WB RGGB Levels Measured : 2425 1022 1025 1475
Color Temp Measured : 6636
WB RGGB Levels Daylight : 2158 1024 1024 1727
Color Temp Daylight : 5200
WB RGGB Levels Shade : 2479 1024 1024 1427
Color Temp Shade : 7000
WB RGGB Levels Cloudy : 2325 1024 1024 1556
Color Temp Cloudy : 6000
WB RGGB Levels Tungsten : 1705 1127 1127 3010
Color Temp Tungsten : 3200
WB RGGB Levels Fluorescent : 1928 1061 1061 2624
Color Temp Fluorescent : 3674
WB RGGB Levels Kelvin : 2356 1024 1024 1529
Color Temp Kelvin : 6218
WB RGGB Levels Flash : 2341 1024 1024 1540
Color Temp Flash : 6127
Raw Measured RGGB : 37253 196754 196380 307131
Custom Picture Style File Name :
AF Micro Adj Mode : Disable
AF Micro Adj Value : 0
Peripheral Lighting : Off
Peripheral Lighting Value : 49
Original Image Width : 5616
Original Image Height : 3744
Peripheral Lighting Setting : Off
User Comment :
Sub Sec Time : 31
Sub Sec Time Original : 31
Sub Sec Time Digitized : 31
Flashpix Version : 0100
Color Space : sRGB
Exif Image Width : 3744
Exif Image Height : 5616
Focal Plane X Resolution : 3849.211765
Focal Plane Y Resolution : 3908.141975
Focal Plane Resolution Unit : inches
Custom Rendered : Normal
Exposure Mode : Manual
Scene Capture Type : Standard
GPS Version ID : 2.2.0.0
Compression : JPEG (old-style)
Thumbnail Offset : 24908
Thumbnail Length : 12778
Image Width : 512
Image Height : 768
Encoding Process : Baseline DCT, Huffman coding
Bits Per Sample : 8
Color Components : 3
Y Cb Cr Sub Sampling : YCbCr4:4:0 (1 2)
Aperture : 3.5
Drive Mode : Single-frame Shooting
File Number : 100-6379
Image Size : 512x768
Lens : 28.0 - 75.0 mm
Lens ID : Canon EF 28-70mm f/2.8L or Sigma 28-70mm f/2.8 EX
Scale Factor To 35 mm Equivalent: 1.0
Shooting Mode : Manual
Shutter Speed : 1/200
Create Date : 2012:07:15 16:44:59.31
Date/Time Original : 2012:07:15 16:44:59.31
Modify Date : 2012:07:15 16:44:59.31
Thumbnail Image : (Binary data 12778 bytes, use -b option to extract)
WB RGGB Levels : 2411 1024 1024 1450
Blue Balance : 1.416016
Circle Of Confusion : 0.031 mm
Field Of View : 51.5 deg
Focal Length : 38.0 mm (35 mm equivalent: 37.3 mm)
Hyperfocal Distance : 13.48 m
Lens : 28.0 - 75.0 mm (35 mm equivalent: 27.5 - 73.6 mm)
Light Value : 11.3
Red Balance : 2.354492
https://www.ads-software.com/extend/plugins/image-rotation-fixer/
]]>