Image maintenance resizing KB. Free or paid cost dependant.

Started by jeffrey scott, August 15, 2009, 05:20:25 PM

Previous topic - Next topic

Kays

Thanks. off hand I can't see why it would interfer with my mod. Also in looking at the error log, one upload error by you seems to confirm that GD 2 is installed.

Can you attach Sources/Display.php to a post

If at first you don't succeed, use a bigger hammer. If that fails, read the manual.
My Mods


Kays

LOL, it works fine. You just needed to set the max width and height for posted limages under "Features and Options". I've got it set for 800 X 600 for the moment  I also downsized the size of the thumbnails.

Edit:

Just discovered something interesting. In the Attachment settings if you check that you want avatars saved as .png, then all thumbnails will be saved as .png also. That's not bad if your thumbnails are a small size. But if the thumbnails are are a bit in the large side, then the file size of each can be substantial. Check out the motorcycle pic. 61 KB for the thumbnail and 88 KB for the full sized image.

It is possible to rewite change the mod so that the same resize function is used for thumbnails also.

What size are the thumbnails on your forum?


If at first you don't succeed, use a bigger hammer. If that fails, read the manual.
My Mods

Gargoyle

I think the mod file for this has an error here...


<operation>
         <search position="after"><![CDATA[?>]]></search>


Shouldn't that be "before" instead of "after" ??

Arantor

No, that's correct.

What it says is put the ?> after your inserted code, so that's correct.

Gargoyle

The mod file reads that the code would be placed after the ?>

Um....

Starts at line 64....

Arantor

No. <search position="after"><![CDATA[?>]]></search> states to put the ?> AFTER the new code. If that was incorrect, every one of the 25 mods I've written (of which 5 are still pending) would fail instantly.

Gargoyle

LOL that means that every mod I have installed I have done wrong....

Kays

If that happened, you'd notice it. :)

Just a follow up on my last post. I have looked at resizing the thumbnails as .jpg but haven't been completely successful.

If at first you don't succeed, use a bigger hammer. If that fails, read the manual.
My Mods

Gargoyle

No I have just always had to do it manually due to my package manager not working most all the time...

So when it said before... I added before the listed code... and after with after... Oh my... Its a wonder my site still works...

Gargoyle

I am getting and undefined index error from this line of code...

$attachmentData[$i]['size'] = round($attachment['filesize'] / 1024, 2) . ' ' . $txt['kilobyte'];

8: Undefined index: kilobyte

Ideas ?

Kays

Make sure you place that first block of code after it checks if the attachment is an image. Which is the search position.

If at first you don't succeed, use a bigger hammer. If that fails, read the manual.
My Mods

Gargoyle

Quote from: Kays on October 04, 2009, 12:20:09 PM
Make sure you place that first block of code after it checks if the attachment is an image. Which is the search position.

lol I did do that.... ;D

Arantor

The undefined index just means it doesn't know what to make of $txt['kilobyte'] which means it wasn't added to Modifications.{your language}.php.

Gargoyle


Kays

My error since I'm working with both versions on SMF

Replace $txt['kilobyte'] with $txt['smf211']

If at first you don't succeed, use a bigger hammer. If that fails, read the manual.
My Mods

Gargoyle

Well the mod seems to work very well...

I will have to see what this does to server load..

Thanks so much!

Kays

It is only called when an image is oversized. Once it's the proper size the script is ignored.

If at first you don't succeed, use a bigger hammer. If that fails, read the manual.
My Mods

Gargoyle

Um...

I am getting the white screen of death when users try to post large images. Could this be a limitation of GD or my host not allowing the image to complete ?

Arantor

Could well be host limitation. Check the webserver error log.

Advertisement: