Automatic Attachment Rotation (and Resize)

Started by dougiefresh, March 04, 2016, 07:34:59 PM

Previous topic - Next topic

GL700Wing

That iMagick error (ie, invalid colormap index) could be caused by a corrupt image (possibly a GIF).

BTW: The image file name is ./attachments/372_275496b80036df18775e7cc514eb1787a8b8edcd.dat
Life doesn't have to be perfect to be wonderful ...

Slava
Ukraini!
"Before you allow people access to your forum, especially in an administrative position, you must be aware that that person can seriously damage your forum. Therefore, you should only allow people that you trust, implicitly, to have such access." -Douglas

sbartelski

And it sems to be running now, did about 700 and then:

Fatal error: Uncaught ImagickException: Bogus DQT index 10 `/home/dh_p6nj8d/clc-smf-test.dreamhosters.com/attachments/2738_3fa02b5d7980b984af97be4fb340d82e313e586c.dat' @ error/jpeg.c/JPEGErrorHandler/335 in /home/dh_p6nj8d/clc-smf-test.dreamhosters.com/Sources/Subs-AutoRotation.php:2062 Stack trace:
#0 /home/dh_p6nj8d/clc-smf-test.dreamhosters.com/Sources/Subs-AutoRotation.php(2062): Imagick->__construct('/home/dh_p6nj8d...')
#1 /home/dh_p6nj8d/clc-smf-test.dreamhosters.com/Sources/Subs-AutoRotation.php(1103): AutoRotation_Process('/home/dh_p6nj8d...', 1, '65', 'jpeg')
#2 /home/dh_p6nj8d/clc-smf-test.dreamhosters.com/Sources/Subs-ResizeExistingImages.php(163): AutoRotation_ResizeExisting(Array)
#3 /home/dh_p6nj8d/clc-smf-test.dreamhosters.com/Sources/Subs.php(6030): ResizeBatch()
#4 /home/dh_p6nj8d/clc-smf-test.dreamhosters.com/Sources/ManageAttachments.php(92): call_helper('ResizeBatch')
#5 /home/dh_p6nj8d/clc-smf-test.dreamhosters.com/Sources/Admin.php(499): ManageAttachments()
#6 /home/dh_p6nj8d/clc-smf-test.dreamhosters.com/index.php(186): AdminMain()
#7 {main} thrown in /home/dh_p6nj8d/clc-smf-test.dreamhosters.com/Sources/Subs-AutoRotation.php on line 2062

I did do the Attachment Integrity Test, clicked all boxes.
Stefan Bartelski
Webmaster for the Cadillac LaSalle Discussion forums

sbartelski

Quote from: GL700Wing on March 12, 2024, 02:58:40 PMThat iMagick error (ie, invalid colormap index) could be caused by a corrupt image (possibly a GIF).

BTW: The image file name is ./attachments/372_275496b80036df18775e7cc514eb1787a8b8edcd.dat
Can I exclude .dat files from processing?
Stefan Bartelski
Webmaster for the Cadillac LaSalle Discussion forums

GL700Wing

Quote from: sbartelski on March 12, 2024, 03:01:09 PM
Quote from: GL700Wing on March 12, 2024, 02:58:40 PMThat iMagick error (ie, invalid colormap index) could be caused by a corrupt image (possibly a GIF).

BTW: The image file name is ./attachments/372_275496b80036df18775e7cc514eb1787a8b8edcd.dat
Can I exclude .dat files from processing?

You can't - that's the extension given to all attachments.

However, and instead of using the batch resizing option you could use Administration Center => Attachments and Avatars => Browse FilesBrowse Files => Resize, Rotate and/or Reformat Existing Images to process groups of selected files.
You cannot view this attachment.

You cannot view this attachment.
Life doesn't have to be perfect to be wonderful ...

Slava
Ukraini!
"Before you allow people access to your forum, especially in an administrative position, you must be aware that that person can seriously damage your forum. Therefore, you should only allow people that you trust, implicitly, to have such access." -Douglas

sbartelski

I will try to delete the offending file and then rerun the integrity check. Hope that I can find the file, at 80K files, even the file manager has a problem. Going to try FileZilla.

Thanks for your help.
Stefan
Stefan Bartelski
Webmaster for the Cadillac LaSalle Discussion forums

sbartelski

I did try that alreday, but one by one. How do I do a group?

Quote from: GL700Wing on March 12, 2024, 03:12:52 PM
Quote from: sbartelski on March 12, 2024, 03:01:09 PM
Quote from: GL700Wing on March 12, 2024, 02:58:40 PMThat iMagick error (ie, invalid colormap index) could be caused by a corrupt image (possibly a GIF).

BTW: The image file name is ./attachments/372_275496b80036df18775e7cc514eb1787a8b8edcd.dat
Can I exclude .dat files from processing?

You can't - that's the extension given to all attachments.

However, and instead of using the batch resizing option you could use Administration Center => Attachments and Avatars => Browse FilesBrowse Files => Resize, Rotate and/or Reformat Existing Images to process groups of selected files.
You cannot view this attachment.

You cannot view this attachment.

Stefan Bartelski
Webmaster for the Cadillac LaSalle Discussion forums

GL700Wing

Quote from: sbartelski on March 12, 2024, 03:15:13 PMI did try that alreday, but one by one. How do I do a group?
There should be checkboxes next to the image file names to enable you to select multiple images for processing.
You cannot view this attachment.
Life doesn't have to be perfect to be wonderful ...

Slava
Ukraini!
"Before you allow people access to your forum, especially in an administrative position, you must be aware that that person can seriously damage your forum. Therefore, you should only allow people that you trust, implicitly, to have such access." -Douglas

Klauser

Got an error while installing on a upgraded 2.0.19 > 2.1.4 Version

Package installation error
At least one error was found when testing the installation of the package.
It is strongly recommended that you do not proceed with the installation if you are not sufficiently knowledgeable or have not made a recent backup.

This error message may indicate a conflict between the package being installed and an existing package, an error in the package itself, or an incompatibility between the package and the SMF version.

./Sources/Subs-Graphics.php    Test failed

;

// Nothing to do without GD or IM/MW
Code (before insert) Select
, $modSettings



Kindred

Слaва
Украинi

Please do not PM, IM or Email me with support questions.  You will get better and faster responses in the support boards.  Thank you.

"Loki is not evil, although he is certainly not a force for good. Loki is... complicated."

sts_pro

#549
I just updated to SMF 2.1 and now manual rotation, under the post while editing, is disappeared. Anyone else is having this problem?

Found it! :) For anyone else wondering: it is now under More > Image rotation menu - not inside More > Modify interface

GL700Wing

#550
Quote from: sts_pro on April 01, 2024, 06:40:27 AMI just updated to SMF 2.1 and now manual rotation, under the post while editing, is disappeared. Anyone else is having this problem?

Found it! :) For anyone else wondering: it is now under More > Image rotation menu - not inside More > Modify interface
There are screenshots with info about the SMF 2.0 and SMF 2.1 options included with the mod description and a zip file containing all the mod screenshots can be downloaded via the 'Packages' tab.
You cannot view this attachment.

Life doesn't have to be perfect to be wonderful ...

Slava
Ukraini!
"Before you allow people access to your forum, especially in an administrative position, you must be aware that that person can seriously damage your forum. Therefore, you should only allow people that you trust, implicitly, to have such access." -Douglas

woolly bugger

I recently did a large upgrade to get rid of a problem mod that couldn't be uninstalled. Then I went about reinstalling all the useful mods on the forum. After several days I realized that I still had not reinstalled Auto Attachment Rotate and Resize.  Sometime after successfully installing it my forum is or appears to be using all of my allotted cpu and php.

Is it possible that this mod is crawling my forum and looking at every (10,000+) existing photo and attempting to resize it? My host tech support hasn't been able to identify the root cause of this and my site has become unusable to the point where I can't get to the admin / package page to uninstall the mod to see it is the culprit.

- pulling hair out 

Sir Osis of Liver

This mod must be installed/uninstalled in proper sequence with one or two related mods, as per instructions on mod site.  If you are unable to uninstall the mod with package manager, and it's the last mod installed, look in \Packages\backups for the backup made before mod install, download, unzip, upload to forum root.  That will restore forum to where it was before mod was installed.
Ashes and diamonds, foe and friend,
 we were all equal in the end.

                                     - R. Waters

GL700Wing

Quote from: woolly bugger on April 25, 2024, 09:05:46 PMIs it possible that this mod is crawling my forum and looking at every (10,000+) existing photo and attempting to resize it?
In a word 'No'.

Resizing/compression of existing images can only happen when:
1. An admin manually selects a group of images to process when browsing attachment files;
2. An admin manually starts the batch resize/compress process for all existing images (this has a built in pause function); or
3. And only if the relevant setting is enabled, when a logged in member views images on a topic page.


QuoteMy host tech support hasn't been able to identify the root cause of this and my site has become unusable to the point where I can't get to the admin / package page to uninstall the mod to see it is the culprit.
To disable the mod you can use cPanel to access the "settings" table and set the value of the following setting to 0: attachment_enableAutoRotateMod

Also, and to ensure images are not automatically resized/compressed when viewed by logged in members set the value of the following setting to 0: attachment_resize_existing

You cannot view this attachment.
The settings referred to above are shown as follows on the mod settings screen:
'Enable the Automatic Attachment Rotation (and Resize) mod'
'Automatically process existing images using the settings above when messages are displayed'
Life doesn't have to be perfect to be wonderful ...

Slava
Ukraini!
"Before you allow people access to your forum, especially in an administrative position, you must be aware that that person can seriously damage your forum. Therefore, you should only allow people that you trust, implicitly, to have such access." -Douglas

woolly bugger

Quote from: GL700Wing on April 26, 2024, 01:17:50 AM
Quote from: woolly bugger on April 25, 2024, 09:05:46 PMIs it possible that this mod is crawling my forum and looking at every (10,000+) existing photo and attempting to resize it?
In a word 'No'.



Thanks for this info... the problem appears to be more complex DDOS which we are trying to resolve.

In over my head...

Kindred

Слaва
Украинi

Please do not PM, IM or Email me with support questions.  You will get better and faster responses in the support boards.  Thank you.

"Loki is not evil, although he is certainly not a force for good. Loki is... complicated."

Advertisement: