Advertisement:

Author Topic: Automatic Attachment Rotation  (Read 27809 times)

Offline dan4ever

  • Jr. Member
  • **
  • Posts: 104
  • Gender: Male
  • SMF 2.0.11
Re: Automatic Attachment Rotation
« Reply #20 on: July 06, 2016, 12:59:48 PM »
Hi, again


Have your latest update installed but the pic are still 45% wrong.


/Dan


The problem is still here...


/Dan
/Dan Ohlsson, Admin at http://www.guldforum.se

Offline dougiefresh

  • SMF Hero
  • ******
  • Posts: 2,671
  • Mod King
    • XPtsp.com Community
Re: Automatic Attachment Rotation
« Reply #21 on: July 12, 2016, 07:07:09 PM »
I'm trying to write the modification to the admin area where you can change the rotation of individual attachments manually....  Haven't forgotten about ya, just REALLY busy with work and a few other things.  :(
News: Missing GitHub repository...

My Free Simple Machines mods on XPtsp.com, Simple Machines Customization Site, and at GitHub!
Problem uninstalling mods?  Try Arantor's Sortable Packages (and Installed Time) mod!  It's super helpful!

Offline dan4ever

  • Jr. Member
  • **
  • Posts: 104
  • Gender: Male
  • SMF 2.0.11
Re: Automatic Attachment Rotation
« Reply #22 on: July 13, 2016, 05:58:08 AM »
Thanx!!!!!
/Dan Ohlsson, Admin at http://www.guldforum.se

Offline dougiefresh

  • SMF Hero
  • ******
  • Posts: 2,671
  • Mod King
    • XPtsp.com Community
Re: Automatic Attachment Rotation
« Reply #23 on: August 20, 2016, 06:16:47 PM »
About a month ago, I've lost my job and have been severely depressed.  I need some help, so if you want to help, please do so!

I've uploaded this mod to GitHub here: https://github.com/douglasorend/Automatic_Attachment_Rotation
News: Missing GitHub repository...

My Free Simple Machines mods on XPtsp.com, Simple Machines Customization Site, and at GitHub!
Problem uninstalling mods?  Try Arantor's Sortable Packages (and Installed Time) mod!  It's super helpful!

Offline dougiefresh

  • SMF Hero
  • ******
  • Posts: 2,671
  • Mod King
    • XPtsp.com Community
Re: Automatic Attachment Rotation
« Reply #24 on: September 15, 2016, 08:01:31 PM »
Okay, I've started writing the stuff to manually rotate the images.  Attached is the current "mock-up" of the attachment screen...  Keep in mind that it is not set in stone yet, but the implementation doing it this way seems pretty straight forward.  Tell me what y'all think about this!  Thanks!
News: Missing GitHub repository...

My Free Simple Machines mods on XPtsp.com, Simple Machines Customization Site, and at GitHub!
Problem uninstalling mods?  Try Arantor's Sortable Packages (and Installed Time) mod!  It's super helpful!

Offline dougiefresh

  • SMF Hero
  • ******
  • Posts: 2,671
  • Mod King
    • XPtsp.com Community
Re: Automatic Attachment Rotation
« Reply #25 on: September 17, 2016, 09:34:32 PM »
Uploaded v2.0 - September 17th, 2016
o Rewrote image processing function to work with built-in imagerotate and imageflip.
o Added several missing database query close statements.
o Added Admin changes to manually change the orientation of attachments.
News: Missing GitHub repository...

My Free Simple Machines mods on XPtsp.com, Simple Machines Customization Site, and at GitHub!
Problem uninstalling mods?  Try Arantor's Sortable Packages (and Installed Time) mod!  It's super helpful!

Offline KungFuJoe

  • Semi-Newbie
  • *
  • Posts: 58
Re: Automatic Attachment Rotation
« Reply #26 on: September 20, 2016, 12:54:18 PM »
Can someone assist with the issue I posted about earlier?  I really really want to try out this mod since many of my users post pic attachments and they always come out the wrong way.

Thanks!

Offline dougiefresh

  • SMF Hero
  • ******
  • Posts: 2,671
  • Mod King
    • XPtsp.com Community
Re: Automatic Attachment Rotation
« Reply #27 on: September 20, 2016, 04:16:12 PM »
Uploaded v2.1 - September 20th, 2016
o Fixed unknown column error in Display.php that occurs when thumbnails are disabled.



@kungfujoe:  Whoops!!  I didn't realize I missed a bug report!  I'm pretty sure it's been fixed for this version!!  Thank you for bringing it up again!
News: Missing GitHub repository...

My Free Simple Machines mods on XPtsp.com, Simple Machines Customization Site, and at GitHub!
Problem uninstalling mods?  Try Arantor's Sortable Packages (and Installed Time) mod!  It's super helpful!

Offline KungFuJoe

  • Semi-Newbie
  • *
  • Posts: 58
Re: Automatic Attachment Rotation
« Reply #28 on: September 20, 2016, 06:18:45 PM »
Uploaded v2.1 - September 20th, 2016
o Fixed unknown column error in Display.php that occurs when thumbnails are disabled.



@kungfujoe:  Whoops!!  I didn't realize I missed a bug report!  I'm pretty sure it's been fixed for this version!!  Thank you for bringing it up again!

Thanks for looking into this.  I uninstall 2.0 and installed 2.1 but now I get the following:

Parse error: syntax error, unexpected '(' in /home2/yandc/public_html/test.xxxxx.net/Sources/Subs-AutoRotation.php on line 193

Offline KungFuJoe

  • Semi-Newbie
  • *
  • Posts: 58
Re: Automatic Attachment Rotation
« Reply #29 on: September 20, 2016, 06:30:18 PM »
I'm I'm definitely not a programmer but I think it was just an extra set of parenthesis around this part of code:

($row['thumb_rotation'])

Do you see the same on your end?  When I remove them, it seems to work.  But just want to make sure I'm not screwing something up.

Offline dougiefresh

  • SMF Hero
  • ******
  • Posts: 2,671
  • Mod King
    • XPtsp.com Community
Re: Automatic Attachment Rotation
« Reply #30 on: September 20, 2016, 06:44:44 PM »
Uploaded v2.2 - September 20th, 2016
o Fixed syntax error found in Subs-AutoRotation.php.  Thanks, kungfujoe!


I'm I'm definitely not a programmer but I think it was just an extra set of parenthesis around this part of code:

($row['thumb_rotation'])

Do you see the same on your end?  When I remove them, it seems to work.  But just want to make sure I'm not screwing something up.
@kungfujoe:  Yeah, I looked at the code real closely and saw that.  I can't believe I missed that....   Thanks for reporting the bug!
« Last Edit: September 20, 2016, 07:24:12 PM by dougiefresh »
News: Missing GitHub repository...

My Free Simple Machines mods on XPtsp.com, Simple Machines Customization Site, and at GitHub!
Problem uninstalling mods?  Try Arantor's Sortable Packages (and Installed Time) mod!  It's super helpful!

Offline KungFuJoe

  • Semi-Newbie
  • *
  • Posts: 58
Re: Automatic Attachment Rotation
« Reply #31 on: September 20, 2016, 06:51:54 PM »
Ok...I'm able to install the mod successfully.

However, it doesn't appear to be rotating images at all.  Could it be that I'm missing the phpExifRW class in PHP?

I see the option to rotate images in the Admin section, but I don't have any thumbnails for my images so it's difficult to know which way to rotate the images that are uploaded.

Offline KungFuJoe

  • Semi-Newbie
  • *
  • Posts: 58
Re: Automatic Attachment Rotation
« Reply #32 on: September 20, 2016, 06:55:06 PM »
Ok...I can simply click on the image name and it will bring up a pop up window with the image so I can work off that.

However, when I try to rotate an image, I get the following:

Fatal error: Call to undefined function AutoRotation_Rotate() in /home2/yandc/public_html/test.xxxxx.net/Sources/ManageAttachments.php on line 157

Offline dougiefresh

  • SMF Hero
  • ******
  • Posts: 2,671
  • Mod King
    • XPtsp.com Community
Re: Automatic Attachment Rotation
« Reply #33 on: September 20, 2016, 07:24:03 PM »
Revised v2.2 - September 20th, 2016
o Fixed syntax error found in Subs-AutoRotation.php.  Thanks, kungfujoe!
o Fixed issue in the attachment screen, where attachment IDs were not being sent correctly.
o Fixed undefined index error in Subs-AutoRotation.php.
o Added forgotten package instruction to run add_remove_hooks.php during package operations.



@Everybody:  Since nobody downloaded the original v2.2, I've fixed a few issues within it....

However, it doesn't appear to be rotating images at all.  Could it be that I'm missing the phpExifRW class in PHP?
No, that class is contained in Class-exifReader.php and is loaded by Subs-AutoRotation.php only if the needed EXIF function aren't available.  Once you rotate an image in the admin panel, you will have to force a refresh (CTRL-F5) on the image in order to see the result.
« Last Edit: September 20, 2016, 08:01:56 PM by dougiefresh »
News: Missing GitHub repository...

My Free Simple Machines mods on XPtsp.com, Simple Machines Customization Site, and at GitHub!
Problem uninstalling mods?  Try Arantor's Sortable Packages (and Installed Time) mod!  It's super helpful!

Offline KungFuJoe

  • Semi-Newbie
  • *
  • Posts: 58
Re: Automatic Attachment Rotation
« Reply #34 on: September 21, 2016, 12:54:47 AM »
Thanks for continuing to work on this.

One typo I found is that when you choose to rotate an image in the Admin section, it prompts you if you want to REMOVE the image.  It rotates it fine...but the text is a bit misleading.  I'm sure it's an easy fix...but just FYI.

Offline KungFuJoe

  • Semi-Newbie
  • *
  • Posts: 58
Re: Automatic Attachment Rotation
« Reply #35 on: September 21, 2016, 12:56:23 AM »
Ok...so now the rotate function is working.

Couple questions.

Any photo I take with my iPhone in Portrait mode is turned to the left sideways.  Is this supposed to be happening or should the exif data be telling the mod how to position the picture upright?  The pic is position correctly when I look at it in any viewer in Windows/MacOS

Are users able to rotate their own images or can it only be done from within the admin console?

Offline dougiefresh

  • SMF Hero
  • ******
  • Posts: 2,671
  • Mod King
    • XPtsp.com Community
Re: Automatic Attachment Rotation
« Reply #36 on: September 21, 2016, 11:42:46 PM »
Ok...so now the rotate function is working.
Good to hear!

Any photo I take with my iPhone in Portrait mode is turned to the left sideways.  Is this supposed to be happening or should the exif data be telling the mod how to position the picture upright?  The pic is position correctly when I look at it in any viewer in Windows/MacOS
Yes, the EXIF information tells the mod how to rotate and/or flip the image so that it is viewed correctly.  There are several reasons why this might happen.  First, the EXIF information itself is incorrect (can't fix).  Second, the mod is reading the EXIF information incorrectly (can fix).  Third, the mod is rotating the image incorrectly (can fix).  Fourth, there is no EXIF information in the image (can't fix).

Can you attach the ORIGINAL image in question to a post or send by PM?  I need to examine and experiment with the image....

Are users able to rotate their own images or can it only be done from within the admin console?
Currently, it can only be done within the admin console.  I'll add some more stuff so that regular users can rotate their own images.....
News: Missing GitHub repository...

My Free Simple Machines mods on XPtsp.com, Simple Machines Customization Site, and at GitHub!
Problem uninstalling mods?  Try Arantor's Sortable Packages (and Installed Time) mod!  It's super helpful!

Offline KungFuJoe

  • Semi-Newbie
  • *
  • Posts: 58
Re: Automatic Attachment Rotation
« Reply #37 on: September 22, 2016, 02:53:00 PM »
If I attach the image here won't this forum just strip out the EXIF information?

Perhaps I could email you?

Offline dougiefresh

  • SMF Hero
  • ******
  • Posts: 2,671
  • Mod King
    • XPtsp.com Community
Re: Automatic Attachment Rotation
« Reply #38 on: September 22, 2016, 04:53:32 PM »
If I attach the image here won't this forum just strip out the EXIF information?

Perhaps I could email you?
You are right, it might strip out the EXIF information.  I'll PM you with my email address.

EDIT: I did some testing using images from GitHub on two different platforms: PHP 5.7 (which has the imagerotate and imageflip functions built-in), as well as PHP 5.3.9 (which do not). Both rotate and flip the images correctly, so I don't think it's the mod....

Hmmmm....  I didn't think about the forum itself stripping out the EXIF information....  I'll further look into this.
« Last Edit: September 22, 2016, 05:19:34 PM by dougiefresh »
News: Missing GitHub repository...

My Free Simple Machines mods on XPtsp.com, Simple Machines Customization Site, and at GitHub!
Problem uninstalling mods?  Try Arantor's Sortable Packages (and Installed Time) mod!  It's super helpful!

Offline dougiefresh

  • SMF Hero
  • ******
  • Posts: 2,671
  • Mod King
    • XPtsp.com Community
Re: Automatic Attachment Rotation
« Reply #39 on: September 22, 2016, 06:57:13 PM »
@kungfujoe: I got your picture.  The EXIF information is there and appears correct.  However, my localhost SMF install won't allow me to attach it to a post....  Hmmmm.

EDIT:  The Simple Machines Forum does, though....  I uninstalled the mod from my localhost, then tried again to attach it.  Still failed, so clearly this particular issue isn't a mod issue.  However, I can't test it if I can't upload it to my localhost server....   :o
« Last Edit: September 22, 2016, 07:45:57 PM by dougiefresh »
News: Missing GitHub repository...

My Free Simple Machines mods on XPtsp.com, Simple Machines Customization Site, and at GitHub!
Problem uninstalling mods?  Try Arantor's Sortable Packages (and Installed Time) mod!  It's super helpful!