EyalAr / lwip

Light Weight Image Processor for NodeJS
MIT License
2.36k stars 231 forks source link

Exception occurs after processing several image files #267

Closed michael-ts closed 8 years ago

michael-ts commented 8 years ago

I am issuing a request for several image crop/rotates in sequence. When I get to the 12th image, I get an exception:

/Users/michael/node/node_modules/lwip/node_modules/decree/dist/cjs/decree.js:80
throw Error(errs); > ^
Error: Unknown arguments configuration,399.47036069889555,-411.42999308271203,3685.5296393011045,3009.429993082712 at Error (native)
at Object.crop (/Users/michael/node/node_modules/lwip/node_modules/decree/dist/cjs/decree.js:80:27)
at Batch.crop (/Users/michael/node/node_modules/lwip/lib/BatchPrototypeInit.js:177:16)
at /Users/michael/node/server.js:347:5
at /Users/michael/node/node_modules/lwip/lib/obtain.js:48:25

However, when I process the 12th image first (same arguments to crop) it works properly.

Putting debug statements in decree.js suggests that when it doesn't work it is missing a fifth argument, a function.

There doesn't seem to be any clean-up functions or close to try to free up resources when done with an image.

michael-ts commented 8 years ago

The order of processing the image was a cockpit error... the exception still occurs. The reason for the exception was tracked down to being a negative value for the left or top of the image. It was expected that this would create a crop with blank area in the negative region, but apparently a work around will be needed to emulate this behavior.