News:

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

Main Menu

After loaded a avatar from disk the avatar losing a quality

Started by jsx, November 04, 2012, 02:28:54 AM

Previous topic - Next topic

jsx

Hi, I have a problem, after loaded avatar from disk the avatar look this way:

http://i46.tinypic.com/fo23w8.jpg

How see the colors lost a quality

The avatar should look this way:

http://i46.tinypic.com/vpkj9s.jpg

After loaded a avatar from link the problem isn't appearing, it isn't fault of the graphical program, something must be not this way, only I don't know what. I ask from help in solving this problem.

The problem with loss of the quality is appearing only in jpg format, the problem isn't appearing at the png format. I tested it also on other forum and the same problem there is appearing, what can be a reason that the loaded avatar with the jpg extension losing the quality? I don't think that it is a mistake from me, whether somehow it will manage to do in order to loaded avatar with the jpg format didn't lose the quality, as concerns the text.

mrintech

JPEG files are highly compressed by default.

Maybe you wanna check this option Use PNG for resized avatars: http://wiki.simplemachines.org/smf/Attachments_and_Avatars#Uploadable_avatars

Storman™

Are you getting SMF to resize these avatars when you upload them ?

What settings do you have in:

Admin --> Forum --> Attachments and Avatars --> Avatar Settings

SMF requires the GD Module to be present on the server for image manipulation, do you know if you have this ?

A phpinfo will tell you if it's present: What is a phpinfo() file?

jsx

@mrintech I never had on 1.1.xx forum this problem with avatar jpg, after updating forum to 2.0.2 I noticed this problem after loaded avatar with jpg format.

I check this site and see and maybe something will good.

@Storman™ in Attachments and Avatars > Avatars settings > I have this options:

Outside avatars

Maximum width outside avatar 110px
Maximum hight outside avatar 110px
If avatar is too big... Let the HTML for reducing it

Members avatars

Maximum width sent avatar 110px
Maximum hight sent avatar 110px
Reduce too big avatars
(Requires the GD module) // I have this option included

Again coding potentially of dangerous avatars // I have this option included

I don't know if I have a GD Module, I must ask about this Module GD of my service provider of the server?

Storman™

QuoteI don't know if I have a GD Module, I must ask about this Module GD of my service provider of the server?

I did mention:

A phpinfo will tell you if it's present: What is a phpinfo() file?

jsx

I have a GD Module on the server I asked my host even about it. So what next?

Kays

What's happening is that to resize the image, SMF uses the imagejpeg() function. Which by default has the quality value set at 75. If you wish to increase it, in Subs-Graphics, look for the following:


$success = imagejpeg($dst_img, $destName);


And change it to


$success = imagejpeg($dst_img, $destName, 85);


Changing the 85 to a higher number yet, will increase file size as well as image quality.

Quote
@mrintech I never had on 1.1.xx forum this problem with avatar jpg, after updating forum to 2.0.2 I noticed this problem after loaded avatar with jpg format.

This I find bit strange since for 1.1.x, that value is at 65. ???

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

jsx

@Kays in which file I'm supposed to change it in? Cause I have no idea, if not in the file it where exactly?

This is some mistake from script the smf 2.0.2 that the added avatar with jpg. format along with the added inscription is losing the quality?

jsx


emanuele



Take a peek at what I'm doing! ;D




Hai bisogno di supporto in Italiano?

Aiutateci ad aiutarvi: spiegate bene il vostro problema: no, "non funziona" non è una spiegazione!!
1) Cosa fai,
2) cosa ti aspetti,
3) cosa ottieni.

jsx

@Kays unfortunately this way doesn't work, I increased numbers and nothing helped still this avatar with the inscription looks the same way.

@emanuele thanks for information, but this way which wrote Kays doesn't work.

emanuele

Then you can either try checking "Use PNG for resized avatars" (in: admin > forum > attachments and avatars > avatar settings).
Or (I would assume) disable security checks on avatars, removing the tick to "Re-encode potentially dangerous avatars" and also remove "Resize oversized large avatars".


Take a peek at what I'm doing! ;D




Hai bisogno di supporto in Italiano?

Aiutateci ad aiutarvi: spiegate bene il vostro problema: no, "non funziona" non è una spiegazione!!
1) Cosa fai,
2) cosa ti aspetti,
3) cosa ottieni.

jsx

Unfortunately emanuele your advice didn't also help. I think that it must be mistake in SMF 2.0.2 if uploaded avatar with jpg format which has a inscription losing quality, inscription is losing the quality. Sometime I used SMF 1.1.16 and wasn't this problem.
I'm emphasizing that hasn't this problem with png format.
Get an eyeful if you can and eventually propose this problem for correct in next version SMF.

Antechinus

Then use .png. Seriously, why are you obsessed wth using .jpg?

MrPhil

As mentioned before, JPEG uses "lossy" compression. In technical terms, every time you save the file (as JPEG format), much of the "high frequency" component (fine detail) is stripped out in order to save a lot of space. The higher the quality setting, the less high frequency detail is removed. When dealing with JPEG images, you have to be careful about how many times you save a given file. Each save, even if you haven't changed a thing, loses more detailed content. Save a file enough times, and eventually it will become a fuzzy blob. If you might be editing an image a number of times, it's best to either restart from the original, or save your intermediate steps in a non-lossy format such as PNG, GIF, or the editor's internal format. All modern browsers do a good job of displaying PNG (as well as GIF and JPEG), but older ones have trouble with PNG (especially pre-IE8 with alpha channel transparency).

By the way, JPEG should only be used for photographs and photo-realistic images, where detail loss can be tolerated. Always use GIF or PNG for diagrams, charts, and other "synthetic" images that have large expanses of solid colors and lots of sharp edges between colors. You'll see when some idiot has used JPEG for a diagram or chart, when you see crawly compression artifacts near each color boundary.

I remember back 25 years ago, when JPEG was young, a coworker bitterly complaining that his PC files were suffering "bit rot" and his JPEG images were deteriorating over time. Someone eventually diagnosed it as this guy saving the image each time he viewed it, rather than quitting the editor/display. The images kept getting softer and fuzzier as detail was lost at each save.

jsx

@Antechinus I understand, I have no obsession, I found the mistake and I reported it, why it can't work in jpg? It's all from me.

@MrPhil I understand, I just want to reported this.

Advertisement: