I realize that this is written for using gphoto and PTP, but I don't think
it is necessary to rewrite the whole thing to solve this.
I think something like this would solve this issue with minimum impact on
the current code. The only modification would be some lines in
common/camera_control.c
In somewhat pseudo code, where the bold part is my suggested modifications:
        /*
         * 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);
           *   } else if (fileIsRaw(path,filename) &&
fileIsOnStorageDevice()) {
                    libraw_data_t *raw = libraw_init(0);
                    libraw_processed_image_t *image = NULL;
                    ret = libraw_open_file(raw, filename);
                    ret = libraw_unpack_thumb(raw);
                    .... do stuff with the raw thumb to fit it in to the
preview ....
              }*
          }
        }

Wouldn't a fix like this work?

//Snaggen, also known as the quick and dirty fixer guy :)



2012/11/26 Henrik Andersson <[email protected]>

> No there are 2 ways, wither as a storage device or using PTP, darktable
> code is
> all designed for PTP.
>
> 2012/11/25 Mattias Eriksson <[email protected]>:
> > But isn't is a normal behaviour that a camera registers as a USB storage
> > device? And is there a difference between a camera register as a storage
> > device and putting a sdcard in a card reader?
> >
> > //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

Reply via email to