• Welcome to the Chevereto user community!

    Here users from all over the world gather around to learn the latest about Chevereto and contribute with ideas to improve the software.

    Please keep in mind:

    • 😌 This community is user driven. Be polite with other users.
    • 👉 Is required to purchase a Chevereto license to participate in this community (doesn't apply to Pre-sales).
    • 💸 Purchase a Pro Subscription to get access to active software support and faster ticket response times.

Forced change JPG to JPEG

Gambalunga

💖 Chevereto Fan
I have just been advised of this problem by my users. In fact I am surprised that it has taken this long.
My site is set up specifically to provide an image library for users of the Talk Morgan forum. This forum uses the UBB.threads™ PHP Forum Software which does not function with the .jpeg file extension.. This does not create any problem for embedding images in posts using the BBCode image embed tags but it does create a problem if someone wants to use an image for their avatar.

In searching these forums I came across a very small reference in https://chevereto.com/community/thr...-reserve-for-jpg-image-files.12368/post-73526 which seems to indicate that all .jpg files are now automatically renamed .jpeg

I do understand the desire to maintain only one convention in file names for the same type of file however this does seem to be causing problems. Other than the fact that .jpeg file extensions are a problem for a UBB.threads forum the .jpg extension is much more common. Since legacy files from V.3 are still supported I find it hard to understand why both .jpg and .jpeg extensions are not accepted.

I have searched to see if this behaviour, in Chevereto, is subject to a user configuration but I can not find any reference to it in the Administrator Settings or in the env files. The only possible reference that I found was the line
Code:
'CHEVERETO_IMAGE_FORMATS_AVAILABLE' => '["JPEG","PNG","BMP","GIF","WEBP"]',
Adding "JPG" to the list did not make any difference.

I don't think this is a bug but a policy that has been decided so, for that reason, I am not reporting it as a bug. I do, however, strongly disagree that this change of file name extensions should be forced on users. In my opinion the file names should be preserved in their entirety unless otherwise decided by the site administrator.
 
all .jpg files are now automatically renamed .jpeg
Not exactly, what happened here is that Chevereto since ever detects the file mime-type and from this information it determines the file extension. Before 4.0.4 any 'image/jpeg' was being renamed to .jpg as that was the mime-type mapping. As you may imagine, to wrongly rename .jpeg (the actual extension for that mime) to .jpg (thing ms need) is worse.

https://github.com/chevereto/chever...47efdf82/app/src/Legacy/G/functions.php#L1928

Adding "JPG" to the list did not make any difference.
That controls what you can upload, input for .jpg and .jpeg refer to the same thing.
 
Rodolfo
Thank you for your reply.

Yes. Of course I understand that .jpg and .jpeg refer to the same thing however .jpg is by far away the most common usage. Most Android photos are .jpg and I suspect that the vast majority of files that are uploaded use that extension.

All I want to do is preserve the original extension. Clearly Chevereto can cope with both as files uploaded before 4.0.4 are still handled by the system.

Unfortunately I do not understand the use of the mime. Are you indicating that to add a line at line 1928
Code:
'image/jpg' => 'jpg',

or change line 1945 to
Code:
'jpg' => 'image/jpeg',

would resolve the issue?

Unfortunately it is a long outstanding problem that UBB.threads forums can not use .jpeg files.
 
Last edited:
Clearly Chevereto can cope with both as files uploaded before 4.0.4 are still handled by the system.
Chevereto has never supported two extensions for image/jpeg. I just told you that jpg was used due to the previous mapping, which before 4.0.4 changed all .jpeg to .jpg on upload.

There's no image/jpg mime (doesn't exists), the mime is image/jpeg and the mapping says mime => extension. It detects the mime, then assign the known extension.
 
Chevereto has never supported two extensions for image/jpeg. I just told you that jpg was used due to the previous mapping, which before 4.0.4 changed all .jpeg to .jpg on upload.

There's no image/jpg mime (doesn't exists), the mime is image/jpeg and the mapping says mime => extension. It detects the mime, then assign the known extension.
As you suggested I have created an RFC, to which I see you have added a clarification.

The fact remains that .jpg files uploaded prior to 4.0.4 maintain their original extension. How the internal workings of Chevereto handle this is not important to me.

As far as I can see the only request for change of saving files with the .jpeg extension came from a thread at

Even there the OP wanted to support both types.
I hope to add it. If you can’t do this, please tell me what code to add to the file to support both .JPG and .JPEG format Joint Photographic Experts Group images?

I do understand that thre is a desire to support only one extension however to suppoet the minority use of .jpeg by changing file name extensions may be supporting the "official" extension at the expense of the most commonly used .jpg

Even Wikipedia in their entry on JPEG use .jpg extensions. For example: https://en.m.wikipedia.org/wiki/File:JPEG_example_JPG_RIP_100.jpg
 
Last edited:
Back
Top