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.

Change `.jpeg` extension use by `tile().toFile('output.dz')` to `.jpg`

See original GitHub issue

Is there a way to have sharp use the .jpg file extension for tile output? By default the tiling methods seem to only output to the .jpeg extension. I couldn’t find any API methods for doing so and would prefer not to have to do a post-processing move on all those tiles (I’m setting up a script to batch-convert a large folder of images into tiles) just to get the desired file extension.

Issue Analytics

  • State:closed
  • Created 5 years ago
  • Comments:7 (3 by maintainers)

github_iconTop GitHub Comments

1reaction
gasicommented, Nov 29, 2020

@lovell I like your proposal. This technically would be a breaking change if someone relied on the output defaulting to .jpeg. Are we ok with that given that sharp is pre-1.0?

Last night, I ended up implementing the renaming logic since I could do it on the fly when uploading to S3 without traversing the entire file system.

Whenever I go back to clean up this code, I will try and submit a PR for this 👍

1reaction
dehuszarcommented, Apr 26, 2018

I was able to get by using the file-system. I’ll take a look at the linked code. If I am able to whip up a PR I will.

Thanks!

Read more comments on GitHub >

github_iconTop Results From Across the Web

Output options - High performance Node.js image processing
Set the format and options for tile images via the toFormat , jpeg , png or webp functions. Use a .zip or .szi...
Read more >
How do I convert .JPEG to .JPG? - Microsoft Community
I have all scanned documents in .JPEG format. How can I convert it in to .JPG format. The file type in the folder...
Read more >
Need to Switch a PNG to JPG? How to Convert Image and ...
To easily convert JPEG (or JPG) to PNG, PNG to JPEG, or Google's WebP web file format to JPEG or PNG in Windows,...
Read more >
Reading and saving image files with Python, OpenCV (imread ...
The image file format is automatically determined from the file path extension. If it is .jpg , it is saved as JPEG, and...
Read more >
JPEG - Image File Format
What is a JPEG file? A JPEG is a type of image format that is saved using the method of lossy compression. The...
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