News:

Wondering if this will always be free?  See why free is better.

Main Menu

Larger thumbnails for attached pictures

Started by GlennLever, June 05, 2013, 05:58:30 PM

Previous topic - Next topic

GlennLever

Is there a way to make larger thumb nails for attached uploads, I would like them to be the same size as linked pictures.

If there is away please tell me where to update the option.

Antechinus

Admin, with the other attachment options. You can set it to whatever size you like.


Antechinus

It wont change old ones, only new ones.

GlennLever

The thumb nail created in this post that was added back in February 6, 2013 was enlarged???

http://www.frontenginedragsters.org/forum/index.php?topic=55.msg275#msg275

But in the same thread the post on February 11th was not

http://www.frontenginedragsters.org/forum/index.php?topic=55.msg620#msg620

Kays

Hmm, it's hard to tell since it looks like guests can't see attachments. ???

However, if the thumbnail size is changed, all thumbnails should be resized as they are being viewed. On the one which won't resize, is the image smaller than the size you have set for thumbnails?

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

GlennLever

Quote from: Kays on June 06, 2013, 10:27:09 AM
Hmm, it's hard to tell since it looks like guests can't see attachments. ???

However, if the thumbnail size is changed, all thumbnails should be resized as they are being viewed. On the one which won't resize, is the image smaller than the size you have set for thumbnails?
I reset the thumb nail size to 800X600

Thumb nail that is large is 592.62 KB 2048X1536

Thumb nail that is still small picture size is 68.31KB 800X533, when clicked on resizes to half screen size.


This one resizes


This one does not

Kays

Quote
Thumb nail that is still small picture size is 68.31KB 800X533, when clicked on resizes to half screen size.

If the image is smaller than the thumbnail size, a thumbnail will not be generated. However it looks like if there is a thumbnail, it still get's displayed.

If you delete that image and then reupload it. The thumbnail should disappear. ;)

I am looking at the code and a quick fix might be possible. But I gotta do some checking first.

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

Kays

Ok, a proper fix for that. This will delete the thumbnail and update the database.

In Display.php look for:


if (!empty($attachment['id_thumb']))
$attachmentData[$i]['thumbnail'] = array(


And add before that:


// If the thumbnail size is increased and the image size is now smaller than that. Remove the old thumbnail so it don't show.
if (!empty($attachment['id_thumb']) && $attachment['width'] <= $modSettings['attachmentThumbWidth'] && $attachment['height'] <= $modSettings['attachmentThumbHeight'])
{
require_once($sourcedir . '/ManageAttachments.php');
removeAttachments(array('id_attach' => $attachment['id_thumb']), '', false, false);

$smcFunc['db_query']('', '
UPDATE {db_prefix}attachments
SET id_thumb = {int:id_thumb}
WHERE id_attach = {int:id_attach}',
array(
'id_thumb' => 0,
'id_attach' => $attachment['id_attach'],
)
);

$attachment['id_thumb'] = 0;
}


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

Advertisement: