-
-
Notifications
You must be signed in to change notification settings - Fork 22
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
Invalid file error while uploading different file format in personal Information admin page. #122
Comments
@uwaiszaki @aryan7081 has not yet signed the Plone Contributor Agreement, and until that happens, should not be assigned any issue. Assignment removed. |
The screenshot indicates Classic UI, not Volto. Transferring issue to the correct repo. |
Confirmed in Plone 6.0.7: Plone 6.0.7 (6018) The problem seems to be the lack of Pillow support for SVG files. When portrait is being set, scale_image method is called where the PIL tries to open it raising the error. # Load up the image, don't try to catch errors, we want to fail miserably
# on invalid images
image = Image.open(image_file) Possible solutions to this issue, at a first glance, could be:
I would choose the first option, as it'd scale the image if SVG support is included by Pillow. Regards Edit: |
I think that the proper thing is to issue an error. |
Option 4I think Plone should accept an SVG for profile images, as some people use SVG icons, not JPG photos. I think that Plone should not attempt to resize an SVG through Pillow because its name itself implies it is a Scalable Vector Graphic and should fit within the space of its HTML container, defined by its CSS. One purpose for resizing is to reduce file size when serving, and that would not happen with SVG (except in the absurd, rare case where a bitmap image was put inside an SVG). It should merely accept it as is, and allow the editor user to specify its size attributes for display. |
I also believe that Plone should support SVG for profile portraits. However, I disagree with letting the user choose the size of the portrait displayed in the author info. This could lead to unexpected layout issues for each user, necessitating overrides of styles or themes. The scale size and format for this feature are currently defined as static settings in In addressing this issue, filtering allowed images should suffice to resolve it. In my opinion, a PLIP (Plone Improvement Proposal) or Enhancement should be initiated to refactor all portrait functionality. Here are my personal thoughts on this:
Advanced changes:
What do you think? Edit: Forgot to say I could work in these changes. |
@rber474 that, sir, is a PLIP worthy proposal. The only question is in which repo should it be made? I think |
@stevepiercy Good question!
Yeah, a few repositories. 😄 Products.PlonePAS and ProductsCMFPlone has the most changes to do... For being my first PLIP not bad. I don't know if there is a way of reference all repositories being affected by a PLIP, if you agree we can create it. |
I would recommend only one primary repo for a PLIP, and cross-referencing other repos from the primary. Choose the repo in which the greatest amount of work or collaboration is needed. I did that for my event content type PLIP. |
Description.
When attempting to upload an SVG (Scalable Vector Graphics) icon as a portrait in the personal information section via the admin page and clicking on the edit button, an error is encountered instead of the expected behavior of displaying a message indicating that the file format is not supported.
Steps to reproduce the behavior:
Expected Behavior:
When attempting to upload an invalid file format as a portrait, the system should display a message indicating that the file format is not supported, rather than throwing an error.
Screenshots
Software (please complete the following information):
Additional context
The text was updated successfully, but these errors were encountered: