Skip to content

vips_thumbnail produces meaningless image on s390x #4815

@mtasaka

Description

@mtasaka

Using released libvips v8.18.0, https://github.com/libvips/libvips/releases/tag/v8.18.0
at least vips_thumbnail (just tried this) produces meaningless image on s390x.

Note that s390x is big endian.

C source:
$ cat resize-to-limit-2.c

#include <stdlib.h>
#include <sys/stat.h>

#define MY_ASSERT(expr) \
do { \
	if (!(expr)) { \
		fprintf(stderr, "LINE[%d] : assertion \"" #expr "\" failed.\n", __LINE__); \
		abort(); \
	} \
} while(0)


int main(void) {
	VipsImage *normal_image;
	int ret;

	const char *input_path = "./portrait.jpg";

	ret = vips_thumbnail(
			input_path, &normal_image,
			400,
			"height", 400,
			"size", VIPS_SIZE_DOWN,
			NULL
		);
	MY_ASSERT(!ret);

	vips_image_write_to_file(normal_image, "resized.jpg", NULL);
}

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions