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

[4.4.4 rc1] - Unable to Save a Rotated image in Media Manager [Error 403 in Console] #43220

Open
exlemor opened this issue Apr 5, 2024 · 10 comments

Comments

@exlemor
Copy link

exlemor commented Apr 5, 2024

Steps to reproduce the issue

Go into J4.4.x or J5.x... Found this while testing J4.4.4 rc1
Go to Media Manager, Upload a .jpg image, Edit image and try to Rotate by pressing 2 times the 90 degree button (the image is now upside down) and try to Save it.

Expected result

You can Save or Save and Close from the rotated state.

Actual result

Nothing happens and you get an error message in Console for each press of the Save button [Firefox]:
XHR
PUT domainname.com/administrator/index.php?option=com_media&format=json&mediatypes=0,1,2,3&task=api.files&path=local-images:/IMG_0736.jpeg [HTTP/2 403 1402ms]

Safari says: Failed to load resource: the server responded with a status of 403 ()
{"success":false,"message":"Unable to upload file.","messages":{"error":["Illegal mime type detected: application/octet-stream"]},"data":null}

System information (as much as possible)

Tried under Firefox 124.0.2 or Safari 17.4.1

Joomla 4.4.4 rc1 but also same issue in Joomla 5.0.3 and Joomla 5.1.0. rc1
PHP 8.2.17 / MySQL 8.0.36

Additional comments

@brianteeman
Copy link
Contributor

Could not replicate using Joomla 5.1.0 rc1

tested on:

  • Chrome 123.0.6312.106 - Windows 11
  • Safari 17.3 on MacOS Sonoma
  • Firefox 124 on macOS Sonoma

@brianteeman
Copy link
Contributor

Correction.

I spotted after I had tested that your file was jpeg while I had tested with jpg

I can confirm errors with the exact same file after it has been renamed to jpeg

@Quy Quy added the bug label Apr 5, 2024
@exlemor
Copy link
Author

exlemor commented Apr 5, 2024

Thank you @brianteeman - after your first message, I thought I was going mad for a second ;) lol

@brianteeman
Copy link
Contributor

could you just confirm that if you rename your image to jpg that there is no problem

@exlemor
Copy link
Author

exlemor commented Apr 6, 2024

Actually better but not entirely perfect... IF I use the .jpg file [attached] from Pizza, Bugs & Fun 2024 from Paris.

Pizza-Bug-Fun-Paris-2024

I get the Save button to not give a Console error which seems a step in the right direction 🚀 but no visual indication/confirmation (like the green line loading in the URL in Safari to tell me it is updating the page etc) or message saying that the image was successfully saved. (only by going back to Media Manager do I know that the image is saved successfully or not).

BUT if I hit the Save button (and NOT seeing any screen indication of success), I then quickly hit Save & Close, I get this in Console:

3 TypeError: null is not an object (evaluating 'Joomla.MediaManager.Edit.xhr.readyState') in /media/com_media/js/edit-images.js?cf352a

(anonymous function) (edit-images.js:277)
N - async
(upload) (edit-images.js:171
(anonymous function) (edit-images.js:276)
(executeTask) (joomla-toolbar-button.js:120)

and nothing moves, i'm stuck not knowing what to do, if it worked etc if I then wait like 10-15 or so seconds and re-hit Save & Close, then it behaves as expected and goes back to the Media Manager with the image rotated as expected.

@brianteeman
Copy link
Contributor

similar problem reported by a user who had filename.JPG
resolved as soon as they changed it filename.jpg

@Quy
Copy link
Contributor

Quy commented Apr 23, 2024

@exlemor Please test #43325 to see if it is a fix. Thanks.

@exlemor
Copy link
Author

exlemor commented Apr 23, 2024

Hello @Quy, so yes it does fix my issue mostly.

It does now work for Cropping, Resizing, Rotating with a .JPG, .jpg, .jpeg, .Jpeg etc and that's wonderful

However, it still does NOT give a message of success when you press the Save button, as expressed above:
"BUT if I hit the Save button (and NOT seeing any screen indication of success)"

every other place in Joomla when you press the Save button gives you a message saying:

(success icon) Article saved.

or

(success icon) Field saved

etc

but here in the Media Manager --> Edit screen it seems someone forgot to connect the Save messages.

@Quy
Copy link
Contributor

Quy commented Apr 23, 2024

Thanks for confirming the fix. Please see #35651 for a related issue.

@dgrammatiko
Copy link
Contributor

@Quy should #43325 be against 4.4.x, currently it's against 5.1?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

5 participants