allan - 2025-03-12


This works with jasper-version-4.2.4 on linux

fix for DevIL/DevIL/src-IL/src/il_jp2.cpp line 317 to 345
copy and past

static ssize_t iJp2_file_read(jas_stream_obj_t obj, char buf, size_t cnt)
{
obj;
return iread(buf, 1, cnt);
}

static ssize_t iJp2_file_write(jas_stream_obj_t obj, const char buf, size_t cnt)
{
obj;
return iwrite(buf, 1, cnt);
}

static long iJp2_file_seek(jas_stream_obj_t *obj, long offset, int origin)
{
obj;


// We could just pass origin to iseek, but this is probably more portable.
switch (origin)
{
case SEEK_SET:
return iseek(offset, IL_SEEK_SET);
case SEEK_CUR:
return iseek(offset, IL_SEEK_CUR);
case SEEK_END:
return iseek(offset, IL_SEEK_END);
}
return 0; // Failed
}

 

Last edit: allan 2025-03-12