Jump to content

Recommended Posts

iMaks533
Posted

Can you tell me what could be the reason that when you try to upload a poster for a movie in the .webp format is the download icon spinning endlessly through image editing in the browser? With the format .jpg does not have such a problem, it downloads files of any size immediately.

  • Agree 2
  • 4 weeks later...
brothom
Posted (edited)

@iMaks533@LukeI'm currently also experiencing issues uploading a webp as an image (primary, logo, etc).

Looks like a check in the JS is failing:

apiclient.js:1 Uncaught Error: File must be an image.
    at ApiClient.uploadItemImage (apiclient.js:1:56394)
    at HTMLFormElement.onSubmit (imageuploader.js:1:2659)

Pinpointing this to `apiclient.js` on line :

        if ("image/png" !== file.type && "image/jpeg" !== file.type && "image/jpeg" !== file.type)
            throw new Error("File must be an image.");

Image/jpeg also exists twice in this line?
Did someone maybe accidentally remove image/webp?

image.png.0977e5a7a5159faeefb5b87c1ba09ff8.png

If I can be so bold, I'd suggest rewriting this to an "includes" method:

        if (["image/jpeg", "image/jpg", "image/webp"].includes(file.type) == false)
            throw new Error("File must be an image.");

That keeps issues like this from happening because it's much more readable.

Edited by brothom

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
×
×
  • Create New...