Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

File type .xcf (GIMP file) causing uncatchable error #115

Open
georgezhang opened this issue Sep 19, 2016 · 1 comment
Open

File type .xcf (GIMP file) causing uncatchable error #115

georgezhang opened this issue Sep 19, 2016 · 1 comment
Labels

Comments

@georgezhang
Copy link

georgezhang commented Sep 19, 2016

When resize and upload a file .xcf it can crash the nodejs process as error below. The problem is due to imagemagick generated multple files for individual layers after resized .xcf . The file name with suffix -n.jpg unmatched with the version path in _upload function. fs.createReadStream(version.path) emitted error not catchable inside aws-sdk.

events.js:141
throw er; // Unhandled 'error' event
^

Error: ENOENT: no such file or directory, open 'uploads/92c4fce2-e7f0-4ff7-8e3c-9245e3f7ea26/arrow_4_xxl-thumb1.jpg'
at Error (native)

[nodemon] app crashed - waiting for file changes before starting...

Temporary fix suggestion (validate the existence of version.path):

Image.prototype._upload = function _upload(dest, version, cb) {
fs.stat(version.path, function (err_file) {
if (err_file) return cb(err_file);
......
});
};

@anthonyringoet
Copy link
Contributor

@georgezhang If you have a solution for this problem, feel free to publish a pull request.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

3 participants