Skip to content

[6.x] Fix pjpg format being used as file extension in AssetUploader#14134

Merged
jasonvarga merged 1 commit intostatamic:6.xfrom
lwekuiper:fix/normalize-pjpg-extension-in-asset-uploader
Mar 3, 2026
Merged

[6.x] Fix pjpg format being used as file extension in AssetUploader#14134
jasonvarga merged 1 commit intostatamic:6.xfrom
lwekuiper:fix/normalize-pjpg-extension-in-asset-uploader

Conversation

@lwekuiper
Copy link
Contributor

When an asset container has a source_preset with 'fm' => 'pjpg' (progressive JPEG), uploaded images get saved with a .pjpg file extension instead of .jpg.

This happens because AssetUploader::getNewExtension() returns the raw Glide format value without normalizing pjpg to jpg.

This normalization already exists in three other places:

This PR adds the same normalization to AssetUploader::getNewExtension().

When a source preset uses 'pjpg' (progressive JPEG), the uploaded file
was saved with a .pjpg extension instead of .jpg. This normalization
already exists in Glide's Encoder, Server, and Statamic's GlideManager
but was missing in AssetUploader::getNewExtension().
@lwekuiper lwekuiper changed the title fix: normalize pjpg format to jpg extension in AssetUploader [6.x] Fix pjpg format being used as file extension in AssetUploader Mar 3, 2026
@jasonvarga jasonvarga merged commit 88df8a5 into statamic:6.x Mar 3, 2026
18 of 19 checks passed
@lwekuiper lwekuiper deleted the fix/normalize-pjpg-extension-in-asset-uploader branch March 3, 2026 15:02
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants