the problem is you don't have the raw file. it's on the camera and now you have to talk to gphoto.
On Mon, Nov 26, 2012 at 11:00 AM, Mattias Eriksson <[email protected]> wrote: > I realize that the import was modified to use the embedded raw thumbnails, > and looking at the import code I find this: > int ret; > libraw_data_t *raw = libraw_init(0); > libraw_processed_image_t *image = NULL; > ret = libraw_open_file(raw, filename); > if(ret) goto libraw_fail; > ret = libraw_unpack_thumb(raw); > if(ret) goto libraw_fail; > > I assume that this code will unpack the thumbnail from the raw file, without > reading the whole file. So maybe something similar could be used in the > import dialog for the case when gphoto doesn't provide a preview and the > file is a raw file? > > > 2012/11/25 Mattias Eriksson <[email protected]> >> >> When I'm thinking about this, I guess gphoto2 is the wrong place for >> something like this since it handles the transport and not parsing of raw >> files. I guess the raw library should be extended (if it doesn't already >> have it) with a function to read the embeded thumbnails with as little >> overhead as possible? Does that sound like the right way to solve this? It >> would be good to hear from the RAW specialists about how to handle this. >> >> //Snaggen >> >> >> >> 2012/11/25 Mattias Eriksson <[email protected]> >>> >>> >From what I understand it is this code passage in the file >>> common/camera_control.c that handles the previews. So the situation as I >>> understand it is that when we connect the camera directly, the gphoto >>> library is served a preview by the camera. But when we connect the sdcard >>> gphoto will not have a preview version of the image and the file size of my >>> raw files is larger than 512000 bytes. But since NEF files actually have a >>> preview embeded it might be possible to read this without reading the whole >>> file? But maybe that should be inside gphoto2? Does anyone have any >>> knowledge about that library? >>> >>> /* >>> * Fetch image preview if flagged... >>> */ >>> if( flags & CAMCTL_IMAGE_PREVIEW_DATA ) >>> { >>> gp_file_new(&preview); >>> if( gp_camera_file_get(c->active_camera->gpcam, path, filename, >>> GP_FILE_TYPE_PREVIEW,preview,c->gpcontext) < GP_OK ) >>> { >>> // No preview for file lets check image size to se if we >>> should download full image for preview... >>> if( cfi.file.size > 0 && cfi.file.size < 512000 ) >>> if( gp_camera_file_get(c->active_camera->gpcam, path, >>> filename, GP_FILE_TYPE_NORMAL,preview,c->gpcontext) < GP_OK ) >>> { >>> preview=NULL; >>> dt_print(DT_DEBUG_CAMCTL,"[camera_control] failed to >>> retreive preview of file %s\n",filename); >>> } >>> } >>> } >>> >>> >>> //Snaggen >> >> > > > ------------------------------------------------------------------------------ > Monitor your physical, virtual and cloud infrastructure from a single > web console. Get in-depth insight into apps, servers, databases, vmware, > SAP, cloud infrastructure, etc. Download 30-day Free Trial. > Pricing starts from $795 for 25 servers or applications! > http://p.sf.net/sfu/zoho_dev2dev_nov > _______________________________________________ > darktable-devel mailing list > [email protected] > https://lists.sourceforge.net/lists/listinfo/darktable-devel > ------------------------------------------------------------------------------ Monitor your physical, virtual and cloud infrastructure from a single web console. Get in-depth insight into apps, servers, databases, vmware, SAP, cloud infrastructure, etc. Download 30-day Free Trial. Pricing starts from $795 for 25 servers or applications! http://p.sf.net/sfu/zoho_dev2dev_nov _______________________________________________ darktable-devel mailing list [email protected] https://lists.sourceforge.net/lists/listinfo/darktable-devel
