News:

Bored?  Looking to kill some time?  Want to chat with other SMF users?  Join us in IRC chat or Discord

Main Menu

JPG for thumbnails

Started by Aaron, August 03, 2007, 03:44:51 PM

Previous topic - Next topic

Aaron

Link to Mod

What is it?
By default SMF saves all thumbnails as PNGs when the setting "Use PNG for resized avatars" is enabled. This mods adds an extra setting to the Manage Attachments screen: "Always use JPG for thumbnails".

How does it work?
When this setting is enabled, thumbnails will be saved in JPG (quality 65) instead of a real-colour PNG. This makes the thumbnails a lot smaller, and thus a lot of disk space and data traffic is saved!

Optimization
I recommend to delete all existing thumbnails after installing the mod and enabling the extra setting, so all existing thumbnails are regenerated and disk space gets freed.

FAQ
Will this mod affect the quality of the actual attachments or avatars?
No, it won't effect either of them.

I don't see the extra setting?
You're likely not to use the English or Dutch language pack, or an UTF version of either of them. Open the file /Themes/default/Modifications.YOURLANGUAGE.php, and add the following line just above ?>:

$txt['attachmentThumbnailsJPG'] = 'Always use JPG for thumbnails';

Eleglin

For french users :
$txt['attachmentThumbnailsJPG'] = 'Utiliser le format JPG pour les miniatures';

Cheers  :D
No support by PM or Mail.

Aaron

Thanks Eleglin. I'll add it to my local copy of the package, so next versions will install it automagicly. :)

Eleglin

Does we need GD library for this ?
No support by PM or Mail.

Aaron

Yes, but the GD library is a requirement for the PNG thumbnails SMF uses by default too.

ApplianceJunk

QuoteBy default SMF saves all thumbnails as PNGs

Why did SMF use PNGs to start with and not JPGs?


ApplianceJunk

Quotewhen the setting "Use PNG for resized avatars" is enabled

Were do I find this setting.
Is it only on the SMF Gallery Pro edition?

Aaron

Go to Admin => Attachments and Avatars => Avatar Settings. It's not necessary to disable it for this mod to work though, and I recommend leaving it on, actually.

ApplianceJunk

Quote from: Aäron on August 04, 2007, 10:08:13 AM
Go to Admin => Attachments and Avatars => Avatar Settings. It's not necessary to disable it for this mod to work though, and I recommend leaving it on, actually.

Ok,  now that also answers my first question. :)

Quote
PNGs are larger, but offer better quality compression. If this is unchecked, JPEG will be used instead - which is often smaller, but also of lesser or blurry quality.

So then what is the difference in using your mode for JPGs and just unchecked the box to use PNGs so JPEG will be used instead?

Are JPGs and JPEGs the same?

Thanks,

Aaron

JPG and JPEG are the same format. The formal abbreviation is JPEG, but JPG is the actual file extension used.

ApplianceJunk

Quote from: Aäron on August 04, 2007, 10:17:49 AM
JPG and JPEG are the same format. The formal abbreviation is JPEG, but JPG is the actual file extension used.

So then what is the difference in using your mode for JPGs and just unchecked the box to use PNGs so JPEG will be used instead?

Are they better with your mod?

Aaron

The difference is that with my mod avatars will still be using PNG. Some images require alpha transparency, which is only achieved with PNG images.

Minare

Great job Aäron , thanks for your efforts.

And for turkish users , u can add this as well ;)

$txt['attachmentThumbnailsJPG'] = 'Thumbnailler için her zaman jpg formatı kullan';

have a nice time.

Aaron


ltdeta

#14
German:
$txt['attachmentThumbnailsJPG'] = 'benutze JPG für Minaturansicht';


is it possible change  the quality ?

ok i found it myself

if you want to change the quality you must change function resizeImage in Subs-Graphics.php
// Save it!
if (!empty($modSettings['avatar_download_png']) && ($is_avatar || !$modSettings['attachmentThumbnailsJPG']))
imagepng($dst_img, $destName);
else
imagejpeg($dst_img, $destName, 65);


this line imagejpeg($dst_img, $destName, 65);

denzil69

installs fine, get a $ code line at top of main page.
no option showing in admin area.

Aaron

Quote from: denzil69 on March 05, 2008, 10:29:50 AM
installs fine, get a $ code line at top of main page.
no option showing in admin area.

Sounds like something went wrong installing the mod. Could you post the exact code appearing at the top of your forum and the version of SMF you're using?

Aaron

Added a package for use with SMF 2.0 beta 3 public to the mod site. :)

rajani

For Finnish users.


$txt['attachmentThumbnailsJPG'] = 'Käytä aina JPG-esikatselukuvia';


Kiitos.

noaccess

This adding will not be updated anymore? :) I find it really annoying that everything is displayed in png.

Advertisement: