Skip to content

Commit

Permalink
πŸ› Fix vips_thumbnail for macos build
Browse files Browse the repository at this point in the history
  • Loading branch information
dbouron committed May 3, 2022
1 parent 0ff230a commit a7b3f52
Showing 1 changed file with 1 addition and 4 deletions.
5 changes: 1 addition & 4 deletions src/main/c/VipsImage.c
Original file line number Diff line number Diff line change
Expand Up @@ -230,18 +230,15 @@ Java_com_criteo_vips_VipsImage_thumbnailImageNative(JNIEnv *env, jobject obj, ji
}

JNIEXPORT jobject JNICALL
Java_com_criteo_vips_VipsImage_thumbnailNative(JNIEnv *env, jobject obj, jstring filename, jint width, jint height, jboolean scale)
Java_com_criteo_vips_VipsImage_thumbnailNative(JNIEnv *env, jclass cls, jstring filename, jint width, jint height, jboolean scale)
{
jobject cls = (*env)->FindClass(env, "com/criteo/vips/VipsImage");
VipsImage *out = NULL;
const char *name = (*env)->GetStringUTFChars(env, filename, NULL);
VipsSize vipsSize = scale ? VIPS_SIZE_FORCE : VIPS_SIZE_BOTH;

if (vips_thumbnail(name, &out, width, "height", height, "size", vipsSize, NULL))
{
(*env)->ReleaseStringUTFChars(env, filename, name);
throwVipsException(env, "Unable to make thumbnail");
return;
}
(*env)->ReleaseStringUTFChars(env, filename, name);
return (*env)->NewObject(env, cls, ctor_mid, (jlong) out);
Expand Down

0 comments on commit a7b3f52

Please sign in to comment.