Advertisement:

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

Offline GL700Wing

  • Full Member
  • ***
  • Posts: 447
  • Gender: Female
Re: Automatic Attachment Rotation (and Resize)
« Reply #200 on: May 16, 2018, 08:18:21 AM »
Hi.. Thanks.  It was at 128, I've tried 256 and 512 but it still does the same thing.  As soon as I turn off "automatically rotate" it lets it upload, and I can then still manually rotate it no problem (in fact it does it instantly)..
Have you tried adjusting the settings in the php.ini file for the forum?

These are the settings I'm using for the forum on the higher spec shared server:
memory_limit = 512M
post_max_size = 64M
upload_max_filesize = 64M


Offline GL700Wing

  • Full Member
  • ***
  • Posts: 447
  • Gender: Female
Re: Automatic Attachment Rotation (and Resize)
« Reply #201 on: May 16, 2018, 08:27:13 AM »
Also seeing this error lots of times, but only for guests :-

https://www.theqe2story.com/forum/index.php?topic=6455.0
8: Undefined variable: mp
File: /home/theqesto/public_html/forum/Sources/Class-exifReader.php
Line: 1201
I've never seen that error and I'm unable to reproduce it but if you make the following change to line 1201 of ./Sources/Class-exifReader.php it should fix the problem:

Find:
Code: [Select]
$this->ImageInfo['h']["customRendered"] = ($mp == 0) ? 'Normal Process' : ($mp == 1 ? 'Custom Process' : 'Reserved');
Replace With:
Code: [Select]
$this->ImageInfo['h']["customRendered"] = (!isset($mp) || $mp == 0) ? 'Normal Process' : ($mp == 1 ? 'Custom Process' : 'Reserved');
The change basically makes 'Normal Process' the default value (and this is actually the default value for "customRendered") if '$mp" has not already been defined.

If you can test/confirm this fix I'll include it in the next version.


Offline The QE2 Story Forum

  • Charter Member
  • Jr. Member
  • *
  • Posts: 151
    • The QE2 Story
Re: Automatic Attachment Rotation (and Resize)
« Reply #202 on: May 17, 2018, 06:04:19 PM »
HI there,

I did your suggested change a few hours ago, and am not seeing any errors now.

Cheers,

- Rob

Offline GL700Wing

  • Full Member
  • ***
  • Posts: 447
  • Gender: Female
Re: Automatic Attachment Rotation (and Resize)
« Reply #203 on: May 17, 2018, 07:06:46 PM »
I did your suggested change a few hours ago, and am not seeing any errors now.
Thanks - I'll include this fix in the next update.

BTW - You can leave this fix in place until then as it won't generate any errors in relation to ./Sources/Class-exifReader.php when the current version of the mod is uninstalled as it deletes that file completely.

Offline dougiefresh

  • SMF Hero
  • ******
  • Posts: 2,820
  • Mod King
    • XPtsp.com Community
Re: Automatic Attachment Rotation (and Resize)
« Reply #204 on: May 21, 2018, 11:23:12 PM »
Uploaded v5.6 - May 21st, 2018
o Fixed undefined variable error in Class-exifReader.php.



Replace With:
Code: [Select]
$this->ImageInfo['h']["customRendered"] = (!isset($mp) || $mp == 0) ? 'Normal Process' : ($mp == 1 ? 'Custom Process' : 'Reserved');
I just looked at the code.  Nowhere else is the $mp variable used.  So it should probably read like this:
Code: [Select]
$this->ImageInfo['h']["customRendered"] = (empty($tmp) ? 'Normal Process' : ($tmp == 1 ? 'Custom Process' : 'Reserved'));The empty function also catches if the variable isn't defined.  When your statement is replaced with my above code, this SHOULDN'T happen....

I've integrated this change into this version.  Hopefully, it'll help with the mod....  :P ::)

Offline dan4ever

  • Jr. Member
  • **
  • Posts: 106
  • Gender: Male
  • SMF 2.0.11
Re: Automatic Attachment Rotation (and Resize)
« Reply #205 on: June 09, 2018, 01:50:46 PM »

Hi


Still getting this error:
8: Undefined offset: 9
Fil: /home4/*****/forum/Sources/Display.php
Rad: 1339


Looks like this:
   list ($id_folder, $real_filename, $file_hash, $file_ext, $id_attach, $attachment_type, $mime_type, $is_approved, $id_member, $proper_rotation) = $smcFunc['db_fetch_row']($request);




Something work around maybe?
have 5.5 will upgrade soon


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

Offline GL700Wing

  • Full Member
  • ***
  • Posts: 447
  • Gender: Female
Re: Automatic Attachment Rotation (and Resize)
« Reply #206 on: June 09, 2018, 08:26:11 PM »
Still getting this error:
8: Undefined offset: 9
Fil: /home4/*****/forum/Sources/Display.php
Rad: 1339

Looks like this:
   list ($id_folder, $real_filename, $file_hash, $file_ext, $id_attach, $attachment_type, $mime_type, $is_approved, $id_member, $proper_rotation) = $smcFunc['db_fetch_row']($request);

Does line 1325 (or a line very close to this number) in your ./Sources/Display.php look like this?
Code: [Select]
SELECT a.id_folder, a.filename, a.file_hash, a.fileext, a.id_attach, a.attachment_type, a.mime_type, a.approved, m.id_member, a.proper_rotation

Offline dan4ever

  • Jr. Member
  • **
  • Posts: 106
  • Gender: Male
  • SMF 2.0.11
Re: Automatic Attachment Rotation (and Resize)
« Reply #207 on: June 10, 2018, 07:31:15 AM »

Yes!

SELECT a.id_folder, a.filename, a.file_hash, a.fileext, a.id_attach, a.attachment_type, a.mime_type, a.approved, m.id_member, a.proper_rotation


/Dan
« Last Edit: June 10, 2018, 07:44:53 AM by dan4ever »
/Dan Ohlsson, Admin at http://www.guldforum.se

Offline GL700Wing

  • Full Member
  • ***
  • Posts: 447
  • Gender: Female
Re: Automatic Attachment Rotation (and Resize)
« Reply #208 on: June 10, 2018, 07:18:53 PM »
Yes!
Ok - we’ll I don’t know why those errors are being generated on your forum.  However, given this issue has not been reported previously you could try uninstalling the version you currently have installed (making to sure to fix any uninstall errors) and then install the latest version.

Offline dougiefresh

  • SMF Hero
  • ******
  • Posts: 2,820
  • Mod King
    • XPtsp.com Community
Re: Automatic Attachment Rotation (and Resize)
« Reply #209 on: October 10, 2018, 11:25:47 AM »
Uploaded v5.7 - October 10th, 2018
o No functionality change.
o Updated documentation to point to new website.



@dan4ever:  Sorry to reply so late after your bug report, but did upgrading to v5.6 solve your issue?

Offline TourFL

  • Semi-Newbie
  • *
  • Posts: 60
Re: Automatic Attachment Rotation (and Resize)
« Reply #210 on: November 02, 2018, 09:16:31 AM »
Hello!

I just installed the mod and it seems to work very well. All my forums members (and me) are very grateful for that evolution ;D

But I get followings errors in my logs since I installed:

8: Undefined index: thumb_hash
File: /xxx/web/Sources/Display.php
Line: 1762

8: Undefined index: thumb_folder
File: /xxx/web/Sources/Display.php
Line: 1762

8: Undefined index: thumb_name
File: /xxx/web/Sources/Display.php
Line: 1762

Apparently, it is generated when I post a new picture. Any idea what could cause this?

Thanks a lot!
If you like Fiat 500 and derived models, the SMF forum I'm helping with: www.500-126.com

Offline TourFL

  • Semi-Newbie
  • *
  • Posts: 60
Re: Automatic Attachment Rotation (and Resize)
« Reply #211 on: November 08, 2018, 08:47:28 AM »
Update:
Errors are not created only with the posting of images, but also viewing some pages with attached images (didn't find out yet what kind).
So I get 100+ errors relative to that mod everyday  :(

Here is the problematic code (line 1762 is at the getAttachmentFilename call):
Code: [Select]

        // A proper thumb doesn't exist yet? Create one!
                        if (empty($attachment['id_thumb']) || $attachment['thumb_width'] > $modSettings['attachmentThumbWidth'] || $attachment['thumb_height'] > $modSettings['attachmentThumbHeight'] || ($attachment['thumb_width'] < $modSettings['attachmentThumbWidth'] && $attachment['thumb_height'] < $modSettings['attachmentThumbHeight']))
                         {
                            [....]
                          }
else
    ========>       $thumb_realname = getAttachmentFilename($attachment['thumb_name'], $attachment['id_thumb'], $attachment['thumb_folder'], false, $attachment['thumb_hash']);

// Get timestamp for thumbnail image:
$time = !empty($thumb_realname) && file_exists($thumb_realname) ? filemtime($thumb_realname) : false;

I'm not sure if a previous installation of the mod didn't uninstall well and messed up the file.
Could anybody post how the code should look like in this part of the file? I run with SMT 2.0.15

Thanks in advance for any help!
If you like Fiat 500 and derived models, the SMF forum I'm helping with: www.500-126.com

Offline dougiefresh

  • SMF Hero
  • ******
  • Posts: 2,820
  • Mod King
    • XPtsp.com Community
Re: Automatic Attachment Rotation (and Resize)
« Reply #212 on: November 09, 2018, 07:44:46 PM »
@TourFL:  Can you attach your Sources/Display.php so that I can see what is going on here?

Offline dougiefresh

  • SMF Hero
  • ******
  • Posts: 2,820
  • Mod King
    • XPtsp.com Community
Re: Automatic Attachment Rotation (and Resize)
« Reply #213 on: November 09, 2018, 10:04:05 PM »
@TourFL:  Never mind, I see what is happening.....  Let me fix the issue....

Offline Denny O

  • Charter Member
  • Newbie
  • *
  • Posts: 2
  • Gender: Male
  • The gene pool could use a little chlorine.
Re: Automatic Attachment Rotation (and Resize)
« Reply #214 on: December 10, 2018, 06:11:13 PM »
Dougiefresh,

I know you are busy with all that you do here and about life in general, is the new version about ready to come out?
I'm recently appointed the Admin for our website using SMF 2.0.15 | SMF © 2017, Simple Machines XHTML RSS WAP2

My people need a way to post pics that is stupid proof for old fishermen that have no tech savvy. This seems to be the ticket, isit?

I would like to upload this to our site sometime soon as this is a slower time for posting traffic due to the change between soft water and not quite yet hard water.

I will await your response before I up load the latest version of this mod.

Thanks for your work!
Denny O
Hook'in Walleyes while Watch'in my Hawkeyes!

Offline petewadey

  • Jr. Member
  • **
  • Posts: 152
Re: Automatic Attachment Rotation (and Resize)
« Reply #215 on: December 16, 2018, 09:11:09 AM »
First of all, thanks for a great mod.
A couple of questions
1. Even though I have the "Keep backup of original image file when resizing" box unchecked, I'm getting a new attachments folder, preREI in my file manager. Is this normal? I wasn't expecting to see that.
2. In my original attachment file, a lot of attachments are duplicated with temp, or tmp after the name. I can't say I noticed it before using the mod, so not saying it has anything to do with it, just asking. If it is this mod, is it ok to delete one or the other, as the size of my attachment file has almost doubled.
Thanks
Pete
 

Offline TourFL

  • Semi-Newbie
  • *
  • Posts: 60
Re: Automatic Attachment Rotation (and Resize)
« Reply #216 on: December 18, 2018, 04:45:39 AM »
Hello Dougiefresh!
Any news on the problem with the error logs? I can still send you my Display.php if it helps  ;)

Thanks!
If you like Fiat 500 and derived models, the SMF forum I'm helping with: www.500-126.com

Offline landyvlad

  • Sr. Member
  • ****
  • Posts: 799
  • Gender: Male
    • Michael Reed on Facebook
    • GSX1400 Owners ORG
Re: Automatic Attachment Rotation (and Resize)
« Reply #217 on: February 06, 2019, 06:07:21 AM »
Is the mod 2.1 RC1 compatible?

I assume it is BUT i want to be sure before proceeding. Thanks.
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.

To paraphrase Kindred: "There are no technical solutions to social problems."