summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMarcus Meissner <marcus@jet.franken.de>2012-04-05 16:16:53 +0000
committerMarcus Meissner <marcus@jet.franken.de>2012-04-05 16:16:53 +0000
commit26995ff508e3744d04e8325c3069e8b6ac7dfa96 (patch)
tree585c838309d053a1b2b19c5465d78bdc93b3573f
parentb78773d84be2f44c3e19a1f64b372173bb37d1b1 (diff)
downloadlibgphoto2-26995ff508e3744d04e8325c3069e8b6ac7dfa96.tar.gz
handle broken ObjectInfos from Samsung Galaxy with ICS
git-svn-id: https://svn.code.sf.net/p/gphoto/code/branches/libgphoto2-2_4/libgphoto2@13960 67ed7778-7388-44ab-90cf-0a291f65f57c
-rw-r--r--camlibs/ptp2/ptp-pack.c6
1 files changed, 6 insertions, 0 deletions
diff --git a/camlibs/ptp2/ptp-pack.c b/camlibs/ptp2/ptp-pack.c
index 1059b247d..9d698b8a6 100644
--- a/camlibs/ptp2/ptp-pack.c
+++ b/camlibs/ptp2/ptp-pack.c
@@ -585,6 +585,11 @@ ptp_unpack_OI (PTPParams *params, unsigned char* data, PTPObjectInfo *oi, unsign
oi->ObjectFormat=dtoh16a(&data[PTP_oi_ObjectFormat]);
oi->ProtectionStatus=dtoh16a(&data[PTP_oi_ProtectionStatus]);
oi->ObjectCompressedSize=dtoh32a(&data[PTP_oi_ObjectCompressedSize]);
+
+ /* Stupid Samsung Galaxy developers emit a 64bit objectcompressedsize */
+ if ((data[PTP_oi_filenamelen] == 0) && (data[PTP_oi_filenamelen+4] != 0)) {
+ data += 4;
+ }
oi->ThumbFormat=dtoh16a(&data[PTP_oi_ThumbFormat]);
oi->ThumbCompressedSize=dtoh32a(&data[PTP_oi_ThumbCompressedSize]);
oi->ThumbPixWidth=dtoh32a(&data[PTP_oi_ThumbPixWidth]);
@@ -596,6 +601,7 @@ ptp_unpack_OI (PTPParams *params, unsigned char* data, PTPObjectInfo *oi, unsign
oi->AssociationType=dtoh16a(&data[PTP_oi_AssociationType]);
oi->AssociationDesc=dtoh32a(&data[PTP_oi_AssociationDesc]);
oi->SequenceNumber=dtoh32a(&data[PTP_oi_SequenceNumber]);
+
oi->Filename= ptp_unpack_string(params, data, PTP_oi_filenamelen, &filenamelen);
capture_date = ptp_unpack_string(params, data,