File extension from JPEG.... needs to be saved as JPG when the using it with resize and save image

File extension from JPEG… needs to be saved as JPG when the using it with resize and save image… see the best below from Paul. I can confirm i have the same issue.

File upload and file extensions .jpg .jpeg

So in short…

(Some clients phones output jpeg… but we prefer using .jpg all the time)

When I upload a file with extension. test.jpeg it needs to upload the file as a test.jpg please. Because if I upload the test.jpeg and use resize and save it will save it in the uploads folder as test.jpg … so the resize and save functions is perfect and works as expected…

work-great-and-makes-jpg

But the problem is in the uploads folder I would then end up with 2 files…
the original uploaded file… eg … test.jpeg and the resized file. test.jpg…
But now it writes the original file name into the database test.jpeg…

end-up-with-2-files

What i expect to happen is when i upload a file with a .jpeg extension that it would get uploaded as a jpg and not jpeg… because when i resize the files… it changes it to .jpeg …or is there a filter one can use to do this?

This is the upload properties…

upload-prop

i have tried to do this…
what-i-have-trried

because when it also writes to the database with …

so I guess the it does not matter if it gets uploaded as jpg or jpeg… but then the resize and save functions just need to output the respective file extension of the main file that was uploaded… so if a .jpeg uploaded… then the save should be a .jpeg

i have tried both …AUTO and JPEG in the FORMAT when saving the file

Community Page
Last updated: