question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

MimeType not working!?

See original GitHub issue

Describe the bug

I’ve tried to display .webp images instead of jpeg to reduce file size but I can’t. Tried defaultOptions set default parameter contentType: outputContentType = MimeType.WEBP in sharpTransformer move .webp() resize to right after image.resize, before .jpeg() nothing works. set options={{contentType: MimeType.WEBP}} does add &contentType=image/webp to the URL

But the responses are all image/jpeg image

Your Example Website or App

No response

Steps to Reproduce the Bug or Issue

Describe above

Expected behavior

Response image/webp

Screenshots or Videos

No response

Platform

  • OS: [Windows]
  • Browser: [Chrome]
  • Version: [100.0.4896.127 (Official Build) (64-bit)]

Additional context

No response

Issue Analytics

  • State:closed
  • Created a year ago
  • Comments:12 (9 by maintainers)

github_iconTop GitHub Comments

1reaction
Josh-McFarlincommented, Apr 23, 2022

Found the issue, one moment!

0reactions
tomekrozalskicommented, Jun 15, 2022

@Josh-McFarlin Yes, this is a case when I do not want to resize, but only to change file format. I agree, we should use it with resizing though - that is why I believe the responsive should never be empty. It should not have ? here:

https://github.com/Josh-McFarlin/remix-image/blob/master/src/components/Image/Image.tsx#L9

Moreover we could type it as follows:

responsive: [ResponsiveSize, ...ResponsiveSize[]]

to make sure at least one responsive object was set. I am not sure, that is just quick thought 🤔

Read more comments on GitHub >

github_iconTop Results From Across the Web

Mime type not working - Stack Overflow
I have searched mime types for zip,apk files but they are not working for me (gives error -invalid format as per my code...
Read more >
Properly configuring server MIME types - MDN Web Docs
If you're using the Apache web server, check the Media Types and Character Encodings section of Apache Configuration: .htaccess for examples of ...
Read more >
Mime Type Check not working as expected
Solved: Hi All, I have a some strange behaviour taking place on a basic form I have created on PowerApps Portals.
Read more >
Error message "File type not permitted or mime type does not ...
When an application searches for the MIME type of a file, the application checks the filename against the MIME information files.
Read more >
MIME Type and Uploaded File Type Detection Problem
When selecting a file from input[type=file] , the file type is already determined by the browser (user-agent) follow MIME type format and then ......
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found