Advertisement:

Author Topic: Automatic Attachment Rotation (and Resize)  (Read 34414 times)

Offline Rock Lee

  • Native Language Support Specialist
  • SMF Hero
  • *
  • Posts: 1,800
  • Gender: Male
  • I also speak english :D
    • BomberCode.Oficial on Facebook
    • RockLee-BC on GitHub
    • @Bomber_Code on Twitter
    • Bomber Code ~ La nueva era del conocimiento
Re: Automatic Attachment Rotation
« Reply #120 on: February 12, 2018, 07:47:21 PM »
I just realized the current but you can see at that moment it did not translate, that's why I leave it to Spanish now! 8)


Regards!
¡Regresando como cual Fenix! ~ Bomber Code © 2018
Ayudas - Aportes - Tutoriales - Y mucho mas!!!


Ayudame via PayPal

Offline dougiefresh

  • SMF Hero
  • ******
  • Posts: 2,702
  • Mod King
    • XPtsp.com Community
Re: Automatic Attachment Rotation
« Reply #121 on: February 13, 2018, 10:02:05 PM »
Uploaded v3.9 - February 13th, 2018
o Added Spanish Latin translation, courtsey of Rock Lee.
o Added translators section to README.txt.
o Added LICENSE.txt to satisfy licensing concerns.



@Rock Lee:  Thank you for the translation!!  It's been included in this version!
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 GL700Wing

  • Full Member
  • ***
  • Posts: 436
  • Gender: Female
Re: Automatic Attachment Rotation
« Reply #122 on: February 17, 2018, 06:26:49 AM »
Uploaded v3.9 - February 13th, 2018
Would you please include the fix for A non well formed numeric value encountered in the next release - as requested I have verified that it works with SMF 2.0.15 and PHP 5.6.

Offline dougiefresh

  • SMF Hero
  • ******
  • Posts: 2,702
  • Mod King
    • XPtsp.com Community
Re: Automatic Attachment Rotation
« Reply #123 on: February 17, 2018, 11:30:43 AM »
Uploaded v3.10 - February 17th, 2018
o Included "Non well-formed number" fix by GL700Wing, as discussed here.



@GL700Wing:  Whoops!  I completely forgot about that fix when I released the last version!  It's been included for this version, though!  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 GL700Wing

  • Full Member
  • ***
  • Posts: 436
  • Gender: Female
Re: Automatic Attachment Rotation
« Reply #124 on: February 18, 2018, 10:53:42 PM »
I installed this mod and discovered that, as per this post, images didn't rotate as expected - in fact 'Rotate 90o Clockwise' and 'Rotate 270o Clockwise' both had the opposite effect to what I expected.  In addition, I thought some of the 'action' descriptions (eg, 'Rotate 270o Clockwise' ) could be made clearer (eg, 'Rotate 90o Left').

So - I've made the following minor changes on my forum.

I changed the text strings in ./Themes/default/languages/AutoRotation.english.php as follows:
Code: [Select]
$txt['img_orientation'] = 'Rotate/Flip';
$txt['img_orientation1'] = 'No Change';
$txt['img_orientation2'] = 'Horizontal Flip';
$txt['img_orientation3'] = 'Rotate 180°';
$txt['img_orientation4'] = 'Vertical Flip';
$txt['img_orientation5'] = 'Vertical Flip, Rotate 90° Right';
$txt['img_orientation6'] = 'Rotate 90° Right';
$txt['img_orientation7'] = 'Horizontal Flip, Rotate 90° Right';
$txt['img_orientation8'] = 'Rotate 90° Left';
$txt['img_rotate'] = 'Rotate/Flip Images';

And I've changed the drop-down menu selection order in ./Sources/ManageAttachments.php and ./Themes/default/Post.template.php to:
Code: [Select]
<option value="0">' . $txt['img_orientation1'] . '</option><option value="6">' . $txt['img_orientation6'] . '</option><option value="8">' . $txt['img_orientation8'] . '</option><option value="3">' . $txt['img_orientation3'] . '</option><option value="2">' . $txt['img_orientation2'] . '</option><option value="4">' . $txt['img_orientation4'] . '</option><option value="7">' . $txt['img_orientation7'] . '</option><option value="5">' . $txt['img_orientation5'] . '</option>
« Last Edit: February 18, 2018, 11:05:01 PM by GL700Wing »

Offline dougiefresh

  • SMF Hero
  • ******
  • Posts: 2,702
  • Mod King
    • XPtsp.com Community
Re: Automatic Attachment Rotation
« Reply #125 on: February 20, 2018, 07:36:30 PM »
@Rock Lee:  Can you translate these strings properly for this new version?  Thanks!
Code: [Select]
$txt['img_orientation'] = 'Rotate/Flip';
$txt['img_orientation1'] = 'No Change';
$txt['img_orientation2'] = 'Horizontal Flip';
$txt['img_orientation3'] = 'Rotate 180&deg;';
$txt['img_orientation4'] = 'Vertical Flip';
$txt['img_orientation5'] = 'Vertical Flip, Rotate 90&deg; Right';
$txt['img_orientation6'] = 'Rotate 90&deg; Right';
$txt['img_orientation7'] = 'Horizontal Flip, Rotate 90&deg; Right';
$txt['img_orientation8'] = 'Rotate 90&deg; Left';
$txt['img_rotate'] = 'Rotate/Flip Images';

@GL700Wing:  I'm implementing the changes you suggested.  Once Rock Lee gives me the translations, I'll publish the new version!
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 Rock Lee

  • Native Language Support Specialist
  • SMF Hero
  • *
  • Posts: 1,800
  • Gender: Male
  • I also speak english :D
    • BomberCode.Oficial on Facebook
    • RockLee-BC on GitHub
    • @Bomber_Code on Twitter
    • Bomber Code ~ La nueva era del conocimiento
Re: Automatic Attachment Rotation
« Reply #126 on: February 20, 2018, 08:04:11 PM »
No problem, here they are translated 8)

Code: [Select]
$txt['img_orientation'] = 'Girar / Voltear';
$txt['img_orientation1'] = 'Ning&uacute;n cambio';
$txt['img_orientation2'] = 'Flip horizontal';
$txt['img_orientation3'] = 'Girar 180&deg;';
$txt['img_orientation4'] = 'Vertical Flip';
$txt['img_orientation5'] = 'Vertical Flip, Girar 90&deg; Derecha';
$txt['img_orientation6'] = 'Girar 90&deg; Derecha';
$txt['img_orientation7'] = 'Flip horizontal, Girar 90&deg; Derecha';
$txt['img_orientation8'] = 'Girar 90&deg; Izquierda';
$txt['img_rotate'] = 'Girar / Voltear im&aacute;genes';

Whatever you need, call me...


Regards!
¡Regresando como cual Fenix! ~ Bomber Code © 2018
Ayudas - Aportes - Tutoriales - Y mucho mas!!!


Ayudame via PayPal

Offline dougiefresh

  • SMF Hero
  • ******
  • Posts: 2,702
  • Mod King
    • XPtsp.com Community
Re: Automatic Attachment Rotation
« Reply #127 on: February 20, 2018, 10:15:39 PM »
Uploaded v3.11 - February 20th, 2018
o Updated Spanish Latin translations, courtsey of Rock Lee.
o Changed rotation/flip strings for better understandability, per GL700Wing's post above.
o Changed order of rotation/flip strings in templates, per GL700Wing's post above.



@Rock Lee and @GL700Wing:  Thank you both for your contributions!  They are appreciated, since lately I can't seem to get my sh#t together well enough....  Plus I'm sick with a damn sinus infection from hell!   UGH!!!
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 GL700Wing

  • Full Member
  • ***
  • Posts: 436
  • Gender: Female
Re: Automatic Attachment Rotation
« Reply #128 on: February 20, 2018, 10:29:14 PM »
You're welcome - hope you're feeling better soon.

Online @rjen

  • Jr. Member
  • **
  • Posts: 262
  • Gender: Male
Re: Automatic Attachment Rotation
« Reply #129 on: February 21, 2018, 05:13:32 PM »
I installed this mod and discovered that, as per this post, images didn't rotate as expected - in fact 'Rotate 90o Clockwise' and 'Rotate 270o Clockwise' both had the opposite effect to what I expected.  In addition, I thought some of the 'action' descriptions (eg, 'Rotate 270o Clockwise' ) could be made clearer (eg, 'Rotate 90o Left').

So - I've made the following minor changes on my forum.

I changed the text strings in ./Themes/default/languages/AutoRotation.english.php as follows:
Code: [Select]
$txt['img_orientation'] = 'Rotate/Flip';
$txt['img_orientation1'] = 'No Change';
$txt['img_orientation2'] = 'Horizontal Flip';
$txt['img_orientation3'] = 'Rotate 180&deg;';
$txt['img_orientation4'] = 'Vertical Flip';
$txt['img_orientation5'] = 'Vertical Flip, Rotate 90&deg; Right';
$txt['img_orientation6'] = 'Rotate 90&deg; Right';
$txt['img_orientation7'] = 'Horizontal Flip, Rotate 90&deg; Right';
$txt['img_orientation8'] = 'Rotate 90&deg; Left';
$txt['img_rotate'] = 'Rotate/Flip Images';

And I've changed the drop-down menu selection order in ./Sources/ManageAttachments.php and ./Themes/default/Post.template.php to:
Code: [Select]
<option value="0">' . $txt['img_orientation1'] . '</option><option value="6">' . $txt['img_orientation6'] . '</option><option value="8">' . $txt['img_orientation8'] . '</option><option value="3">' . $txt['img_orientation3'] . '</option><option value="2">' . $txt['img_orientation2'] . '</option><option value="4">' . $txt['img_orientation4'] . '</option><option value="7">' . $txt['img_orientation7'] . '</option><option value="5">' . $txt['img_orientation5'] . '</option>

Nice to see that you picked up my request. I made these changes as well, but got not reply on the question. Thought it was forgotten...
Running SMF 2.0 with Tinyportal 1.5.1 at www.fjr-club.nl
Testing SMF 2.1 beta 4 with Tinyportal 1.5.1 at http://test2.fjr-club.nl/

Offline dougiefresh

  • SMF Hero
  • ******
  • Posts: 2,702
  • Mod King
    • XPtsp.com Community
Re: Automatic Attachment Rotation
« Reply #130 on: February 21, 2018, 07:52:48 PM »
Sorry about that, @rjen!  I really didn't know how to fix it....
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!

Online @rjen

  • Jr. Member
  • **
  • Posts: 262
  • Gender: Male
Re: Automatic Attachment Rotation
« Reply #131 on: February 22, 2018, 04:14:09 AM »
Tested, and looking good.

In the explanation you may also want to update the option descriptions?

It still reads:

Quote
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.

May be changed to:

o No Change
o Rotate 90 degrees Right
o Rotate 90 degrees Left.
o Rotate 180 degrees
o Horizontal Flip
o Vertical Flip
o Horizontal Flip, Rotate 90 degrees Right
o Vertical Flip, Rotate 90 degrees Right

Find attached the language file for Dutch..
Running SMF 2.0 with Tinyportal 1.5.1 at www.fjr-club.nl
Testing SMF 2.1 beta 4 with Tinyportal 1.5.1 at http://test2.fjr-club.nl/

Offline GL700Wing

  • Full Member
  • ***
  • Posts: 436
  • Gender: Female
Re: Automatic Attachment Rotation
« Reply #132 on: February 22, 2018, 04:26:48 AM »
May be changed to:

o No Change
o Rotate 90 degrees Right
o Rotate 90 degrees Left.
o Rotate 180 degrees
o Horizontal Flip
o Vertical Flip
o Horizontal Flip, Rotate 90 degrees Right
o Vertical Flip, Rotate 90 degrees Right

It may even be possible to use the 'degrees' symbol ...
o No Change
o Rotate 90° Right
o Rotate 90° Left
o Rotate 180°
o Horizontal Flip
o Vertical Flip
o Horizontal Flip, Rotate 90° Right
o Vertical Flip, Rotate 90° Right

Offline dougiefresh

  • SMF Hero
  • ******
  • Posts: 2,702
  • Mod King
    • XPtsp.com Community
Re: Automatic Attachment Rotation
« Reply #133 on: February 22, 2018, 09:41:51 AM »
Uploaded v3.12 - February 22nd, 2018
o Added Dutch translation, courtsey of @rjen!
o 2nd attempt: Changed order of rotation/flip strings in templates, per GL700Wing's post above.
o Changed documentation to reflect new order of manual rotation options.



@rjen:  Thank you for the translation!  It's been included in this version!  I've also "reeditted" the install XML files so that the option-order changes are present, cause I'm not sure if they got into the last version....

EDIT:  I finally saw what you were talking about: it's in the documentation....  It's been fixed!  Thanks!
« Last Edit: February 22, 2018, 10:26:50 AM 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 The QE2 Story Forum

  • Charter Member
  • Jr. Member
  • *
  • Posts: 148
    • The QE2 Story
Re: Automatic Attachment Rotation
« Reply #134 on: March 18, 2018, 10:20:38 AM »
Installed and working on 2.0.15.  Thank you.

Only hiccup is when you go to browse files, then rotate an image, the button at the bottom, and the confirmation, both warn you about deleting files, even though I'm only rotating them.

Offline dougiefresh

  • SMF Hero
  • ******
  • Posts: 2,702
  • Mod King
    • XPtsp.com Community
Re: Automatic Attachment Rotation
« Reply #135 on: March 29, 2018, 12:13:00 PM »
Uploaded v4.0 - March 27th, 2018
o Per GL700Wing, fixed issue where images with very large dimensions could not be rotated (Image Processing Memory Limit mod may also be required if issue persists).
o Per GL700Wing, code added to automatically resize images in new and existing topics.
o Per GL700Wing, added automatic rotation and automatic resize for images in PMs if 'PM Attachments' mod is installed.



@GL700Wing:  Thank you for the new version!  It's been converted for use with SMF 2.1 Beta 3, as well!

@The QE2 Story Forum:  I'm not sure where you are talking about.  Are you talking about the admin area?
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 The QE2 Story Forum

  • Charter Member
  • Jr. Member
  • *
  • Posts: 148
    • The QE2 Story
Re: Automatic Attachment Rotation
« Reply #136 on: March 30, 2018, 11:48:13 AM »
Hi there,

I uninstalled 3.12, and tried to install 4.0, but it has failed because the following line in subs-graphics is different on my installation.  I believe this is because I am also using the "Resize Attached Images" mod.

Code: [Select]
$success = imagejpeg($dst_img, $destName, min($modSettings['attachment_image_compression'], 100));

For now, I've re-installed 3.12 again.

Cheers,

- Rob

Offline dougiefresh

  • SMF Hero
  • ******
  • Posts: 2,702
  • Mod King
    • XPtsp.com Community
Re: Automatic Attachment Rotation
« Reply #137 on: March 30, 2018, 12:31:59 PM »
@The QE2 Story Forum: The installation readme notes that the Resize Attached Images mod should NOT be installed prior to the installation of this mod, as they contain similar, but not the same, functionality....  IMO, this should imply that if you have it installed, you should uninstall it before installing this mod...
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 The QE2 Story Forum

  • Charter Member
  • Jr. Member
  • *
  • Posts: 148
    • The QE2 Story
Re: Automatic Attachment Rotation
« Reply #138 on: April 01, 2018, 10:08:46 AM »
@The QE2 Story Forum: The installation readme notes that the Resize Attached Images mod should NOT be installed prior to the installation of this mod, as they contain similar, but not the same, functionality....  IMO, this should imply that if you have it installed, you should uninstall it before installing this mod...

Thank you for replying, and sorry for not reading the instructions properly!   OK so I uninstalled 3.12 version of this mod, and then I uninstalled "resize attached images" too... then I reinstalled version 4 of this mod and - all is well!  Thank you!

Offline The QE2 Story Forum

  • Charter Member
  • Jr. Member
  • *
  • Posts: 148
    • The QE2 Story
Re: Automatic Attachment Rotation
« Reply #139 on: April 02, 2018, 08:46:50 AM »
Just a note - I'm having terrible problems with this now I'm afraid.   It doesn't mean that I don't recommend it to others, just that its caused me a lot of bother overall.

Even though it installs and uninstalls cleanly, I'm getting issues such as zero-byte uploads, and I even have a topic that won't display now until I uninstall the mod...

https://www.theqe2story.com/forum/index.php?action=admin;area=manageattachments;sa=browse;sort=date;desc
2: filemtime(): stat failed for /home/robligh/public_html/forum/attachments/57406_a5e04f2e038e80b207c22b83c11a78a07b0bd6c4
File: /home/robligh/public_html/forum/Sources/ManageAttachments.php(383) : runtime-created function
Line: 17