Advertisement:

Author Topic: Automatic Attachment Rotation  (Read 22611 times)

Offline dougiefresh

  • SMF Hero
  • ******
  • Posts: 2,503
    • XPtsp.com Community
Re: Automatic Attachment Rotation
« Reply #40 on: September 25, 2016, 10:37:23 PM »
UPDATE:  Sorry about the delay in responding.  It took some work, along with a considerable amount of fiddling with the settings of my Apache/PHP/MySQL server that I was using in order to get my localhost forum to upload the image.  Once I did, the forum correctly rotated and/or flipped the image so that it was upright....
NOTICE:  My website is back up!

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: 101
  • Gender: Male
  • SMF 2.0.11
Re: Automatic Attachment Rotation
« Reply #41 on: September 26, 2016, 08:51:55 AM »
Good work!!!!


But I have "Highslide Image Viewer[/size][size=78%]" installed and the big picture that will come up when I click the pic is not turned.[/size]
[/size]Probably incompatibly  whith yours mod.[size=78%]
[/size][size=78%]But I really [/size][size=78%][/size]want the both och if you can include that too !!!!  ????[size=78%]


[/size][size=78%]/Dan  [/size][size=78%]
/Dan Ohlsson, Admin at http://www.guldforum.se

Offline dougiefresh

  • SMF Hero
  • ******
  • Posts: 2,503
    • XPtsp.com Community
Re: Automatic Attachment Rotation
« Reply #42 on: September 26, 2016, 09:39:12 AM »
Uploaded v2.3 - September 26th, 2016
o Added code to include timestamps on attachment URLs to circumvent browser caching.


But I have "Highslide Image Viewer" installed and the big picture that will come up when I click the pic is not turned.
Probably incompatibly  whith yours mod.
But I really want the both och if you can include that too !!!!  ????

Dan
I fixed the mod a few days so that the attachment URLs are modified with the timestamp, just to circumvent the browser caching crap that is built into SMF....  Once an image is turned, it should show up using Highslide Image Viewer as turned.

 :o Btw, what's with all the extra tags?  Makes your post incredibly difficult to read....  Anyway, I removed the extra tags, just so it's readable in quotes....  O:)
NOTICE:  My website is back up!

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: 57
Re: Automatic Attachment Rotation
« Reply #43 on: September 26, 2016, 04:05:47 PM »
UPDATE:  Sorry about the delay in responding.  It took some work, along with a considerable amount of fiddling with the settings of my Apache/PHP/MySQL server that I was using in order to get my localhost forum to upload the image.  Once I did, the forum correctly rotated and/or flipped the image so that it was upright....

Hmmm...the pic doesn't rotate automatically on my site.  Do you think it could be an issue with missing a PHP class?

Offline dougiefresh

  • SMF Hero
  • ******
  • Posts: 2,503
    • XPtsp.com Community
Re: Automatic Attachment Rotation
« Reply #44 on: September 26, 2016, 04:16:33 PM »
Hmmm...the pic doesn't rotate automatically on my site.  Do you think it could be an issue with missing a PHP class?
I doubt it.  If there was a missing PHP class, the topic display wouldn't function.  Let me investigate this bug report.....
NOTICE:  My website is back up!

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 blunted

  • Jr. Member
  • **
  • Posts: 201
Re: Automatic Attachment Rotation
« Reply #45 on: September 28, 2016, 10:07:06 PM »
$txt['img_orientation'] = 'Rotate Clockwise'; $txt['img_orientation1'] = 'None'; $txt['img_orientation2'] = 'Horizontal Flip'; $txt['img_orientation3'] = 'Rotate 180°'; $txt['img_orientation4'] = 'Vertical Flip'; $txt['img_orientation5'] = 'Vertical Flip, Rotate 270°'; $txt['img_orientation6'] = 'Rotate 270°'; $txt['img_orientation7'] = 'Horizontal Flip, Rotate 270°'; $txt['img_orientation8'] = 'Rotate 90°';

getting this in admin

Offline dan4ever

  • Jr. Member
  • **
  • Posts: 101
  • Gender: Male
  • SMF 2.0.11
Re: Automatic Attachment Rotation
« Reply #46 on: September 30, 2016, 05:46:00 AM »

 :o Btw, what's with all the extra tags?  Makes your post incredibly difficult to read....  Anyway, I removed the extra tags, just so it's readable in quotes....  O:)


It comes when I copy/paste...
I don't like it at al...


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

Offline dan4ever

  • Jr. Member
  • **
  • Posts: 101
  • Gender: Male
  • SMF 2.0.11
Re: Automatic Attachment Rotation
« Reply #47 on: September 30, 2016, 06:20:08 AM »
$txt['img_orientation'] = 'Rotate Clockwise'; $txt['img_orientation1'] = 'None'; $txt['img_orientation2'] = 'Horizontal Flip'; $txt['img_orientation3'] = 'Rotate 180°'; $txt['img_orientation4'] = 'Vertical Flip'; $txt['img_orientation5'] = 'Vertical Flip, Rotate 270°'; $txt['img_orientation6'] = 'Rotate 270°'; $txt['img_orientation7'] = 'Horizontal Flip, Rotate 270°'; $txt['img_orientation8'] = 'Rotate 90°';

getting this in admin


Open the file in Theme/default/languages with the name "Admin.english.php"  and at the end there should be a "?>"  and no one before.
Just move this   ?>   one to the end.


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

Offline blunted

  • Jr. Member
  • **
  • Posts: 201
Re: Automatic Attachment Rotation
« Reply #48 on: September 30, 2016, 07:29:14 AM »
$txt['img_orientation'] = 'Rotate Clockwise'; $txt['img_orientation1'] = 'None'; $txt['img_orientation2'] = 'Horizontal Flip'; $txt['img_orientation3'] = 'Rotate 180°'; $txt['img_orientation4'] = 'Vertical Flip'; $txt['img_orientation5'] = 'Vertical Flip, Rotate 270°'; $txt['img_orientation6'] = 'Rotate 270°'; $txt['img_orientation7'] = 'Horizontal Flip, Rotate 270°'; $txt['img_orientation8'] = 'Rotate 90°';

getting this in admin

ty :)
Open the file in Theme/default/languages with the name "Admin.english.php"  and at the end there should be a "?>"  and no one before.
Just move this   ?>   one to the end.


/Dan

Offline dougiefresh

  • SMF Hero
  • ******
  • Posts: 2,503
    • XPtsp.com Community
Re: Automatic Attachment Rotation
« Reply #49 on: October 12, 2016, 10:18:01 AM »
Uploaded v2.4 - October 12th, 2016
o Removed code that may flag images as processed when they haven't been.
o Added an additional check to make sure we only rotate IMAGES!
o Added code in the admin attachment area to clear image orientation flags.
o Added code to prevent double-processing of images and thumbnails.
o Fixed excluded database fields in Display.php database query.
o SMF 2.0: Modified admin attachment code to hook the previous function used.



@Everybody:  Hopefully, this update solves the problem of images not being rotated, but only if they have the EXIF information still in them....  This update will NOT fix images that have been re-encoded for any reason, as the EXIF information has been stripped out of the image.  This update WILL NOT fix any image that never had EXIF information in it.
NOTICE:  My website is back up!

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,503
    • XPtsp.com Community
Re: Automatic Attachment Rotation
« Reply #50 on: October 13, 2016, 08:31:24 PM »
UPDATE: I've been tinkering with the mod in the last few days, getting an option to allow the user to manually rotate their pictures while editing the post.  I've discovered that the attachment information given to the mod's code isn't reliable, and I've have to retool the mod in order to make it work for all pictures, both new and current pics.  I should have a new version out in the next few days, time allowing....

EDIT: Also, the thumbnail doesn't appear to update after the image is manually rotated, unless the browser is forced to reload everything.  This will be fixed with the next version, as well....
« Last Edit: October 13, 2016, 08:47:10 PM by dougiefresh »
NOTICE:  My website is back up!

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,503
    • XPtsp.com Community
Re: Automatic Attachment Rotation
« Reply #51 on: October 15, 2016, 08:14:44 PM »
Uploaded v3.0 - October 15th, 2016
o Added code to the post editing template to manually rotate images.
o Added code to include timestamps on thumbnail URLs to circumvent browser caching.
o Fixed rotation code to get image format instead of relying on database information.
o Reduced potential database requests by merging attachment fetching database requests.
NOTICE:  My website is back up!

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,503
    • XPtsp.com Community
Re: Automatic Attachment Rotation
« Reply #52 on: October 31, 2016, 07:49:57 AM »
Uploaded v3.1 - October 31st, 2016
o Fixed missing array element errors when trying to get thumbnail attachment timestamp.
o Fixed issue where errors where generated because no filename was given to filemtime.
o Fixed LoadLanguage operation so that it does not rely on the global declaration.
NOTICE:  My website is back up!

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: 57
Re: Automatic Attachment Rotation
« Reply #53 on: January 13, 2017, 01:17:42 PM »
I'm not sure if this is browser specific but when I edit a post to rotate an image...when I choose a rotation from the drop down, it will automatically uncheck the attachment.  If someone isn't aware of this and saves the modified post, it will delete the attachment.

Any one else experiencing this?  I'm using Safari on a Mac (Sierra)

Offline KungFuJoe

  • Semi-Newbie
  • *
  • Posts: 57
Re: Automatic Attachment Rotation
« Reply #54 on: January 13, 2017, 02:02:53 PM »
Also, the rotation appears to happen counter clockwise, not clockwise.

Offline dougiefresh

  • SMF Hero
  • ******
  • Posts: 2,503
    • XPtsp.com Community
Re: Automatic Attachment Rotation
« Reply #55 on: January 13, 2017, 09:53:21 PM »
I'm not sure if this is browser specific but when I edit a post to rotate an image...when I choose a rotation from the drop down, it will automatically uncheck the attachment.  If someone isn't aware of this and saves the modified post, it will delete the attachment.

Any one else experiencing this?  I'm using Safari on a Mac (Sierra)
Sorry, I can't reproduce this bug.  I've tested it on a PC with FireFox, Internet Explorer (gasp!) and Chrome.  None of the 3 browsers that I tested have unchecked the attachment box to the left of the attachment name.  I also looked in both the install_20x.xml as well as the Post.template.php, and there is nothing that would clear the attachment checkbox in a clean 2.0.13 forum with this mod installed.

There may be some conflict between this mod and another mod you might be running.  Without a mod list, SMF version number, and mod version number, I wouldn't be able to even guess as to why you're experiencing this issue......

Also, the rotation appears to happen counter clockwise, not clockwise.
I'm going to assume that you mean the image is rotated without you specifying the rotation value, since you haven't given me much to work on.  I can't reproduce this either.  If you change the rotation selection box and then click Post, of course it's going to rotate/flip the image in the direction specified.   That's by design.
NOTICE:  My website is back up!

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: 57
Re: Automatic Attachment Rotation
« Reply #56 on: January 18, 2017, 02:14:40 PM »
I think I'm still on SMF 2.0.12.  Haven't updated to 13 just yet.  I also quite a lot of mods so I will do some testing on my test site to see if one of them is affecting that checkbox.  Just to be clear, it only unchecks the attachment when I modify the rotation using the drop down.  The easy workaround is to simply recheck it.

As for the rotation, it rotates...but the opposite direction.

If you choose 90 degrees...it will rotate 90 degrees counter clockwise. 

Offline dougiefresh

  • SMF Hero
  • ******
  • Posts: 2,503
    • XPtsp.com Community
Re: Automatic Attachment Rotation
« Reply #57 on: January 21, 2017, 09:18:53 AM »
Post your Themes/default/Post.template.php, so I might be able to see what is happening....
NOTICE:  My website is back up!

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 landyvlad

  • Jr. Member
  • **
  • Posts: 330
    • Michael Reed on Facebook
    • GSX1400 Owners ORG
Re: Automatic Attachment Rotation
« Reply #58 on: January 26, 2017, 06:39:42 AM »
OK so I installed it but

1) Is it supposed to auto-rotate existing attachments? Because it didn't in two cases (images do have basic EXIF data) .  I checked first - no then I clicked on the clear rotation flags.  Still no change.

2) Can the user ONLY rotate the attachment at time of upload, and not once attached?  Users often aren't sure of orientation and don't notice until its been attached. Can they then rotate it somehow?

 
Please do not PM, IM or Email me with questions on astrophysics or theology.  You will get better and faster responses by asking homeless people in the street. Thank you.

Offline dougiefresh

  • SMF Hero
  • ******
  • Posts: 2,503
    • XPtsp.com Community
Re: Automatic Attachment Rotation
« Reply #59 on: January 26, 2017, 11:13:44 AM »
1) Is it supposed to auto-rotate existing attachments? Because it didn't in two cases (images do have basic EXIF data) .  I checked first - no then I clicked on the clear rotation flags.  Still no change.
If the mod CAN auto-rotate the image, it is supposed to.

2) Can the user ONLY rotate the attachment at time of upload, and not once attached?  Users often aren't sure of orientation and don't notice until its been attached. Can they then rotate it somehow?
The user can edit the post, go down to the attachments, and instruct the forum to rotate it either 90, 180, or 270 degrees clockwise, and/or flip it horizontally or vertically.  Once that is complete, submit the post and it should be rotated when viewing it next time.
NOTICE:  My website is back up!

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!