Skip to content

Commit

Permalink
translate RAF files to x-fuji-raw mime
Browse files Browse the repository at this point in the history
  • Loading branch information
msmeissn committed Nov 9, 2023
1 parent ebe4e9c commit c174877
Show file tree
Hide file tree
Showing 5 changed files with 19 additions and 5 deletions.
3 changes: 2 additions & 1 deletion camlibs/ptp2/library.c
Original file line number Diff line number Diff line change
Expand Up @@ -2928,7 +2928,8 @@ static struct {
{PTP_OFC_CANON_CR3, PTP_VENDOR_CANON, "image/x-canon-cr3"},
{PTP_OFC_CANON_MOV, PTP_VENDOR_CANON, "video/quicktime"},
{PTP_OFC_CANON_CHDK_CRW, PTP_VENDOR_CANON, "image/x-canon-cr2"},
{PTP_OFC_SONY_RAW, PTP_VENDOR_SONY, "image/x-sony-arw"},
{PTP_OFC_SONY_RAW, PTP_VENDOR_SONY, GP_MIME_ARW},
{PTP_OFC_FUJI_RAW, PTP_VENDOR_FUJI, GP_MIME_RAF},
{0, 0, NULL}
};

Expand Down
8 changes: 8 additions & 0 deletions camlibs/ptp2/ptp.c
Original file line number Diff line number Diff line change
Expand Up @@ -8587,6 +8587,14 @@ ptp_render_ofc(PTPParams* params, uint16_t ofc, int spaceleft, char *txt)
break;
}
break;
case PTP_VENDOR_FUJI:
switch (ofc) {
case PTP_OFC_FUJI_RAW:
return snprintf (txt, spaceleft,"RAF");
default:
break;
}
break;
case PTP_VENDOR_MICROSOFT:
case PTP_VENDOR_MTP:
for (i=0;i<sizeof(ptp_ofc_mtp_trans)/sizeof(ptp_ofc_mtp_trans[0]);i++)
Expand Down
2 changes: 2 additions & 0 deletions camlibs/ptp2/ptp.h
Original file line number Diff line number Diff line change
Expand Up @@ -1501,6 +1501,8 @@ typedef struct _PTPObjectFilesystemInfo PTPObjectFilesystemInfo;
#define PTP_OFC_CANON_CHDK_CRW 0xb1ff
/* Sony */
#define PTP_OFC_SONY_RAW 0xb101
/* Fuji */
#define PTP_OFC_FUJI_RAF 0xb103
/* MTP extensions */
#define PTP_OFC_MTP_MediaCard 0xb211
#define PTP_OFC_MTP_MediaCardGroup 0xb212
Expand Down
1 change: 1 addition & 0 deletions gphoto2/gphoto2-file.h
Original file line number Diff line number Diff line change
Expand Up @@ -59,6 +59,7 @@ extern "C" {
#define GP_MIME_AVCHD "video/mp2t"
#define GP_MIME_RW2 "image/x-panasonic-raw2"
#define GP_MIME_ARW "image/x-sony-arw"
#define GP_MIME_RAF "image/x-fuji-raf"

/**
* \brief The type of view on the specified file.
Expand Down
10 changes: 6 additions & 4 deletions libgphoto2/gphoto2-file.c
Original file line number Diff line number Diff line change
Expand Up @@ -593,6 +593,7 @@ static const char *mime_table[] = {
"mts", GP_MIME_AVCHD,
"m2ts", GP_MIME_AVCHD,
"arw", GP_MIME_ARW,
"raf", GP_MIME_RAF,
"txt", GP_MIME_TXT,
NULL};
/**
Expand Down Expand Up @@ -1089,6 +1090,10 @@ gp_file_adjust_name_for_mime_type (CameraFile *file)
const char *table[] = {
GP_MIME_RAW, "raw",
GP_MIME_JPEG, "jpg",
GP_MIME_NEF, "nef",
GP_MIME_CRW, "crw",
GP_MIME_CR2, "cr2",
GP_MIME_CR3, "cr3",
GP_MIME_PNG, "png",
GP_MIME_PPM, "ppm",
GP_MIME_PGM, "pgm",
Expand All @@ -1097,11 +1102,8 @@ gp_file_adjust_name_for_mime_type (CameraFile *file)
GP_MIME_WAV, "wav",
GP_MIME_BMP, "bmp",
GP_MIME_AVI, "avi",
GP_MIME_CRW, "crw",
GP_MIME_CR2, "cr2",
GP_MIME_CR3, "cr3",
GP_MIME_ARW, "arw",
GP_MIME_NEF, "nef",
GP_MIME_RAF, "raf",
GP_MIME_TXT, "txt",
NULL};

Expand Down

0 comments on commit c174877

Please sign in to comment.