JoomGalleryfriends / JG4-dev

Development repository for JoomGallery v4.x
GNU General Public License v3.0
10 stars 6 forks source link

Add warning message instead of fatal error #82

Closed MrMusic closed 1 year ago

MrMusic commented 1 year ago

Currently, uploading an WEBP file with 'animation' causes a Fatal Error when using GD as image processor, see https://github.com/JoomGalleryfriends/JG4-dev/pull/70#issuecomment-1450110906 This PR prevents the fatal error and issues a warning message instead.

However, what I don't understand is that if an invalid image type is detected (returning false in the analyse function), normally no record in the database table should be created or? An error in the service?

szepty-ziemi commented 1 year ago

Warning is displayed correctly:

obraz

Nevertheless item is still saved with image linking broken. Shouldn't it rather display error and NOT create new item record at all? (Or in this ticket only error message is covered?)

obraz

ENV: https://prnt.sc/EIvRdwp8R254

Elfangor93 commented 1 year ago

I successfully tested the changes. Looks good to me.

@szepty-ziemi I am with you, that the image should not be added in the DB when the imagetypes (thumb, detail, orig) can not be created. But this is a more general issue and should be covered in a separate PR in my opinion.