Add new comment

Sony ARW file use libraw_open_file return -2 error code.

Hi dev~

I used libraw_open_file open my sony ARW photo file, that return -2 error code, but I found our Supported cameras has supported Sony A7M4, can you help me update my code? :(

        libraw_data_t *raw = libraw_init(0);
 
        int code = libraw_open_file(raw, "/Users/pjhubs/Movies/test.ARW");
        if (code != LIBRAW_SUCCESS) {
            // Here return -2 error code.
            NSLog(@"error open file");
        }
 
        if (libraw_unpack_thumb(raw) != LIBRAW_SUCCESS) {
            NSLog(@"error libraw_unpack file");
        }
 
        if (libraw_dcraw_thumb_writer(raw, "/Users/pjhubs/Movies/test.jpeg") != LIBRAW_SUCCESS) {
            NSLog(@"error libraw_dcraw_thumb_writer file");
        }
 
        libraw_close(raw);

my test.ARW file google drive link: https://drive.google.com/file/d/1CgtxGKQjuzMqMji32NP9ryOss0NMroEs/view?u...

Forums: