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.

All images made on Windows have size 0

See original GitHub issue

I use this snippets

        return jimp.read(srcFileName)
            .then( img => {
                img
                .resize(width, jimp.AUTO)
                .quality(75)                 // set JPEG quality
                .write(destFileName);

                returnObj.fname = destFileName;
                console.log("Created new image:", srcFileName);

                return resolve(returnObj);
            })
            .catch (err => reject(err) );

the files are being created but have size 0 bytes in Win 10. All working on Ubuntu though. What could be wrong?

Issue Analytics

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

github_iconTop GitHub Comments

1reaction
oliver-morancommented, Aug 11, 2016

Can’t reproduce on Windows 7 using the following test script:

var Jimp = require("jimp");

Jimp.read("lenna.png").then( img => {
    img
    .resize(100, Jimp.AUTO)
    .quality(75)
    .write("lenna-100px.png");
})
.catch (err => reject(err) );

Does it still present on Windows 10?

0reactions
andrewrpropercommented, Mar 5, 2021

I found an interesting situation. If I use image.write(“filename.jpg”) from within an async function which is called from a Promise, then it doesn’t complete until the top-level Promise is completed, even if I use await.

The fix is to use the Async version every time it is being called from within any async process: image.writeAsync(“filename.jpg”); I think I’ll probably only use writeAsync going forward. The other one was creating strange problems, when used within async and Promises.

Read more comments on GitHub >

github_iconTop Results From Across the Web

Tiny pictures in file explorer - Microsoft Community
I have tried altering view settings, increasing the overall size of text/apps, etc, I have tried going into regedit, all have zero effect....
Read more >
Quickest Way To Reduce Image File Size In Windows 10 ...
This quick way of changing the file size of an image only takes three clicks and will help make the image size small...
Read more >
How to Resize Images with the Windows 10 Photos App
In this video, I will show how to resize images for web or email so that the file size is smaller just with...
Read more >
How to Resize Images on Windows 10 [Tutorial] - YouTube
How to Resize a Photo on your Mac laptop or Computer · How To Reduce Image Size Using MS Paint In Windows 10...
Read more >
Formatting your images for display on the web
Tips for styling images to display clearly on any screen size. ... Images added to galleries display best if all images have a...
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