Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- if (Exist(fname))
- {
- img = corona::OpenImage(fname, corona::FF_AUTODETECT, corona::PF_DONTCARE);
- }
- else
- {
- VFILE* vf = vopen(fname);
- if (!vf)
- {
- err("loadimage: couldn't load image %s; couldnt find a file or a vfile", fname);
- }
- /*FILE* f = fopen("v3img_temp.$$$", "wb");
- if (!f)
- {
- // TODO: implement
- }*/
- int l = filesize(vf);
- char* buffer = new char[l];
- vread(buffer, l, vf);
- //fwrite(buffer, 1, l, f);
- vclose(vf);
- //fclose(f);
- corona::File* memfile = corona::CreateMemoryFile(buffer, l);
- img = corona::OpenImage(memfile, corona::FF_AUTODETECT, corona::PF_DONTCARE);
- delete buffer;
- //remove("v3img_temp.$$$");
- }
Add Comment
Please, Sign In to add comment