/*
- * Copyright (C)2011-2017 D. R. Commander. All Rights Reserved.
+ * Copyright (C)2011-2018 D. R. Commander. All Rights Reserved.
*
* Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions are met:
if ((*env)->GetArrayLength(env, dst) < (jsize)jpegSize)
_throwarg("Destination buffer is not large enough");
+ if (ProcessSystemProperties(env) < 0) goto bailout;
+
bailif0(srcBuf = (*env)->GetPrimitiveArrayCritical(env, src, 0));
bailif0(jpegBuf = (*env)->GetPrimitiveArrayCritical(env, dst, 0));
- if (ProcessSystemProperties(env) < 0) goto bailout;
-
if (tjCompress2(handle, &srcBuf[y * actualPitch + x * tjPixelSize[pf]],
width, pitch, height, pf, &jpegBuf, &jpegSize, jpegSubsamp,
jpegQual, flags | TJFLAG_NOREALLOC) == -1)
if ((*env)->GetArrayLength(env, dst) < (jsize)jpegSize)
_throwarg("Destination buffer is not large enough");
+ if (ProcessSystemProperties(env) < 0) goto bailout;
+
bailif0(srcOffsets = (*env)->GetPrimitiveArrayCritical(env, jSrcOffsets, 0));
bailif0(srcStrides = (*env)->GetPrimitiveArrayCritical(env, jSrcStrides, 0));
for (i = 0; i < nc; i++) {
}
bailif0(jpegBuf = (*env)->GetPrimitiveArrayCritical(env, dst, 0));
- if (ProcessSystemProperties(env) < 0) goto bailout;
-
if (tjCompressFromYUVPlanes(handle, srcPlanes, width, srcStrides, height,
subsamp, &jpegBuf, &jpegSize, jpegQual,
flags | TJFLAG_NOREALLOC) == -1)