bare-jpeg 1.1.2 → 1.1.3
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/binding.c +5 -1
- package/package.json +1 -1
- package/prebuilds/android-arm/bare-jpeg.bare +0 -0
- package/prebuilds/android-arm64/bare-jpeg.bare +0 -0
- package/prebuilds/android-ia32/bare-jpeg.bare +0 -0
- package/prebuilds/android-x64/bare-jpeg.bare +0 -0
- package/prebuilds/darwin-arm64/bare-jpeg.bare +0 -0
- package/prebuilds/darwin-x64/bare-jpeg.bare +0 -0
- package/prebuilds/ios-arm64/bare-jpeg.bare +0 -0
- package/prebuilds/ios-arm64-simulator/bare-jpeg.bare +0 -0
- package/prebuilds/ios-x64-simulator/bare-jpeg.bare +0 -0
- package/prebuilds/linux-arm64/bare-jpeg.bare +0 -0
- package/prebuilds/linux-x64/bare-jpeg.bare +0 -0
- package/prebuilds/win32-arm64/bare-jpeg.bare +0 -0
- package/prebuilds/win32-x64/bare-jpeg.bare +0 -0
package/binding.c
CHANGED
|
@@ -176,6 +176,7 @@ bare_jpeg_encode(js_env_t *env, js_callback_info_t *info) {
|
|
|
176
176
|
|
|
177
177
|
uint8_t *jpeg = NULL;
|
|
178
178
|
unsigned long len = 0;
|
|
179
|
+
uint8_t *dst = NULL;
|
|
179
180
|
jpeg_mem_dest(&encoder, &jpeg, &len);
|
|
180
181
|
|
|
181
182
|
encoder.image_width = width;
|
|
@@ -194,6 +195,9 @@ bare_jpeg_encode(js_env_t *env, js_callback_info_t *info) {
|
|
|
194
195
|
err = js_throw_error(env, NULL, error.message);
|
|
195
196
|
assert(err == 0);
|
|
196
197
|
|
|
198
|
+
free(jpeg);
|
|
199
|
+
free(dst);
|
|
200
|
+
|
|
197
201
|
jpeg_destroy_compress(&encoder);
|
|
198
202
|
|
|
199
203
|
return NULL;
|
|
@@ -201,7 +205,7 @@ bare_jpeg_encode(js_env_t *env, js_callback_info_t *info) {
|
|
|
201
205
|
|
|
202
206
|
jpeg_start_compress(&encoder, true);
|
|
203
207
|
|
|
204
|
-
|
|
208
|
+
dst = malloc((size_t) width * 3);
|
|
205
209
|
|
|
206
210
|
while (encoder.next_scanline < encoder.image_height) {
|
|
207
211
|
const uint8_t *src = data + (size_t) encoder.next_scanline * width * 4;
|
package/package.json
CHANGED
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|