Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fixed: jfif photo uploads don't work #1984

Merged
merged 1 commit into from
Aug 7, 2021
Merged

Fixed: jfif photo uploads don't work #1984

merged 1 commit into from
Aug 7, 2021

Conversation

AntzCode
Copy link
Contributor

@AntzCode AntzCode commented Aug 3, 2021

Background

Since a Windows update in December 2019, Microsoft has configured all of its customers' computers to use .jfif instead of .jpg as the default extension when saving JPEG files:

https://answers.microsoft.com/en-us/windows/forum/all/jpg-vs-jfif-extension/f66875d7-4780-4d55-b8da-9387de4139d4

Since the .jfif protocol has not been widely popular, it is not presently supported by OSSN.

We need to make sure that .jfif uploads work as well as .jpg uploads do.

Solution

In a handful of places, an configuration is sent to OssnFile::setExtension() that defines allowed file types. Wherever there has been found ".jpg" and ".jpeg" file extensions in that configuration, I have added ".jfif".

I also added the reverse mapping (".jfif" to "image/jpeg" mime type) in the applicable places.

The original issue is found here: jfif photo uploads don't work #7

The revision in the main branch of my OSSN fork is here: baa0cb71e587c36ff7499aa5b60c9114d8594d70

Notes

  • This affects a Third Party library (phpMailer).
  • This is a high priority bug because it probably affects most Windows users.

@lianglee
Copy link
Member

lianglee commented Aug 4, 2021

Did you tried to use jfif photos once this patch? did it worked in profile cover, profile photo, album photos, wall posts?

@lianglee
Copy link
Member

lianglee commented Aug 4, 2021

Thanks for the pull, let me know above :) Once confirmed I shall merge it.

@AntzCode
Copy link
Contributor Author

AntzCode commented Aug 5, 2021

Thanks @lianglee, I have tested those four cases you have listed there and confirmed that it works.

@lianglee lianglee changed the title Fixed: jfif photo uploads don't work #7 Fixed: jfif photo uploads don't work Aug 7, 2021
@lianglee lianglee merged commit fadacec into opensource-socialnetwork:v5.x Aug 7, 2021
lianglee added a commit that referenced this pull request Aug 7, 2021
lianglee added a commit that referenced this pull request Aug 7, 2021
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.

None yet

2 participants