1 /* -*- C++ -*-
2  * Copyright 2019-2021 LibRaw LLC (info@libraw.org)
3  *
4  LibRaw is free software; you can redistribute it and/or modify
5  it under the terms of the one of two licenses as you choose:
6 
7 1. GNU LESSER GENERAL PUBLIC LICENSE version 2.1
8    (See file LICENSE.LGPL provided in LibRaw distribution archive for details).
9 
10 2. COMMON DEVELOPMENT AND DISTRIBUTION LICENSE (CDDL) Version 1.0
11    (See file LICENSE.CDDL provided in LibRaw distribution archive for details).
12 
13  */
14 
15 #include "../../internal/dcraw_defs.h"
16 #include "../../internal/libraw_cameraids.h"
17 
setOlympusBodyFeatures(unsigned long long id)18 void LibRaw::setOlympusBodyFeatures(unsigned long long id)
19 {
20   ilm.CamID = id;
21 
22   if ((id == OlyID_E_1)   ||
23       (id == OlyID_E_300) ||
24       ((id & 0x00ffff0000ULL) == 0x0030300000ULL))
25   {
26     ilm.CameraFormat = LIBRAW_FORMAT_FT;
27 
28     if ((id == OlyID_E_1)   ||
29         (id == OlyID_E_300) ||
30         ((id >= OlyID_E_330) && (id <= OlyID_E_520)) ||
31         (id == OlyID_E_620) ||
32         (id == OlyID_E_450) ||
33         (id == OlyID_E_600) ||
34         (id == OlyID_E_5))
35     {
36       ilm.CameraMount = LIBRAW_MOUNT_FT;
37     }
38     else
39     {
40       ilm.CameraMount = LIBRAW_MOUNT_mFT;
41     }
42   }
43   else
44   {
45     ilm.LensMount = ilm.CameraMount = LIBRAW_MOUNT_FixedLens;
46   }
47   return;
48 }
49 
getOlympus_CameraType2()50 void LibRaw::getOlympus_CameraType2()
51 {
52 
53   if (OlyID != 0x0ULL)
54     return;
55 
56   int i = 0;
57   fread(imOly.CameraType2, 6, 1, ifp);
58   imOly.CameraType2[5] = 0;
59   while ((i < 6) && imOly.CameraType2[i])
60   {
61     OlyID = OlyID << 8 | imOly.CameraType2[i];
62     if (i < 5 && isspace(imOly.CameraType2[i + 1])) {
63       imOly.CameraType2[i + 1] = '\0';
64       break;
65     }
66     i++;
67   }
68   if (OlyID == OlyID_NORMA) {
69     if (strcmp(model, "SP510UZ")) OlyID = OlyID_SP_510UZ;
70     else OlyID = 0x0ULL;
71   }
72   unique_id = OlyID;
73   setOlympusBodyFeatures(OlyID);
74   return;
75 }
76 
getOlympus_SensorTemperature(unsigned len)77 void LibRaw::getOlympus_SensorTemperature(unsigned len)
78 {
79   if (OlyID != 0x0ULL)
80   {
81     short temp = get2();
82     if ((OlyID == OlyID_E_1)  ||
83         (OlyID == OlyID_E_M5) ||
84         (len != 1))
85       imCommon.SensorTemperature = (float)temp;
86     else if ((temp != -32768) && (temp != 0))
87     {
88       if (temp > 199)
89         imCommon.SensorTemperature = 86.474958f - 0.120228f * (float)temp;
90       else
91         imCommon.SensorTemperature = (float)temp;
92     }
93   }
94   return;
95 }
96 
parseOlympus_Equipment(unsigned tag,unsigned type,unsigned len,unsigned dng_writer)97 void LibRaw::parseOlympus_Equipment(unsigned tag, unsigned type, unsigned len,
98                                     unsigned dng_writer)
99 {
100   // uptag 2010
101 
102   switch (tag)
103   {
104   case 0x0100:
105     getOlympus_CameraType2();
106     break;
107   case 0x0101:
108     if ((!imgdata.shootinginfo.BodySerial[0]) && (dng_writer == nonDNG))
109       stmread(imgdata.shootinginfo.BodySerial, len, ifp);
110     break;
111   case 0x0102:
112     stmread(imgdata.shootinginfo.InternalBodySerial, len, ifp);
113     break;
114   case 0x0201:
115   {
116     unsigned char bits[4];
117     fread(bits, 1, 4, ifp);
118     ilm.LensID = (unsigned long long)bits[0] << 16 |
119                  (unsigned long long)bits[2] << 8 | (unsigned long long)bits[3];
120     ilm.LensMount = LIBRAW_MOUNT_FT;
121     ilm.LensFormat = LIBRAW_FORMAT_FT;
122     if (((ilm.LensID < 0x20000) || (ilm.LensID > 0x4ffff)) &&
123         (ilm.LensID & 0x10))
124       ilm.LensMount = LIBRAW_MOUNT_mFT;
125   }
126     break;
127   case 0x0202:
128     if ((!imgdata.lens.LensSerial[0]))
129       stmread(imgdata.lens.LensSerial, len, ifp);
130     break;
131   case 0x0203:
132     stmread(ilm.Lens, len, ifp);
133     break;
134   case 0x0205:
135     ilm.MaxAp4MinFocal = libraw_powf64l(sqrt(2.0f), get2() / 256.0f);
136     break;
137   case 0x0206:
138     ilm.MaxAp4MaxFocal = libraw_powf64l(sqrt(2.0f), get2() / 256.0f);
139     break;
140   case 0x0207:
141     ilm.MinFocal = (float)get2();
142     break;
143   case 0x0208:
144     ilm.MaxFocal = (float)get2();
145     if (ilm.MaxFocal > 1000.0f)
146       ilm.MaxFocal = ilm.MinFocal;
147     break;
148   case 0x020a:
149     ilm.MaxAp4CurFocal = libraw_powf64l(sqrt(2.0f), get2() / 256.0f);
150     break;
151   case 0x0301:
152     ilm.TeleconverterID = fgetc(ifp) << 8;
153     fgetc(ifp);
154     ilm.TeleconverterID = ilm.TeleconverterID | fgetc(ifp);
155     break;
156   case 0x0303:
157     stmread(ilm.Teleconverter, len, ifp);
158     if (!strlen(ilm.Teleconverter) && strchr(ilm.Lens, '+')) {
159       if (strstr(ilm.Lens, "MC-20"))
160         strcpy(ilm.Teleconverter, "MC-20");
161       else if (strstr(ilm.Lens, "MC-14"))
162         strcpy(ilm.Teleconverter, "MC-14");
163       else if (strstr(ilm.Lens, "EC-20"))
164         strcpy(ilm.Teleconverter, "EC-20");
165       else if (strstr(ilm.Lens, "EC-14"))
166         strcpy(ilm.Teleconverter, "EC-14");    }
167     break;
168   case 0x0403:
169     stmread(ilm.Attachment, len, ifp);
170     break;
171   }
172 
173   return;
174 }
parseOlympus_CameraSettings(int base,unsigned tag,unsigned type,unsigned len,unsigned dng_writer)175 void LibRaw::parseOlympus_CameraSettings(int base, unsigned tag, unsigned type,
176                                          unsigned len, unsigned dng_writer)
177 {
178   // uptag 0x2020
179 
180   int c;
181   switch (tag)
182   {
183   case 0x0101:
184     if (dng_writer == nonDNG)
185     {
186       thumb_offset = get4() + base;
187     }
188     break;
189   case 0x0102:
190     if (dng_writer == nonDNG)
191     {
192       thumb_length = get4();
193     }
194     break;
195   case 0x0200:
196     imgdata.shootinginfo.ExposureMode = get2();
197     break;
198   case 0x0202:
199     imgdata.shootinginfo.MeteringMode = get2();
200     break;
201   case 0x0301:
202     imgdata.shootinginfo.FocusMode = imOly.FocusMode[0] = get2();
203     if (len == 2)
204     {
205       imOly.FocusMode[1] = get2();
206     }
207     break;
208   case 0x0304:
209     for (c = 0; c < 64; c++)
210     {
211       imOly.AFAreas[c] = get4();
212     }
213     break;
214   case 0x0305:
215     for (c = 0; c < 5; c++)
216     {
217       imOly.AFPointSelected[c] = getreal(type);
218     }
219     break;
220   case 0x0306:
221     imOly.AFFineTune = fgetc(ifp);
222     break;
223   case 0x0307:
224     FORC3 imOly.AFFineTuneAdj[c] = get2();
225     break;
226   case 0x0401:
227     imCommon.FlashEC = getreal(type);
228     break;
229   case 0x0507:
230     imOly.ColorSpace = get2();
231     switch (imOly.ColorSpace) {
232     case 0:
233       imCommon.ColorSpace = LIBRAW_COLORSPACE_sRGB;
234       break;
235     case 1:
236       imCommon.ColorSpace = LIBRAW_COLORSPACE_AdobeRGB;
237       break;
238     case 2:
239       imCommon.ColorSpace = LIBRAW_COLORSPACE_ProPhotoRGB;
240       break;
241     default:
242       imCommon.ColorSpace = LIBRAW_COLORSPACE_Unknown;
243       break;
244     }
245     break;
246   case 0x0600:
247     imgdata.shootinginfo.DriveMode = imOly.DriveMode[0] = get2();
248     for (c = 1; c < (int)len && c < 5; c++)
249     {
250       imOly.DriveMode[c] = get2();
251     }
252     break;
253   case 0x0601:
254   	imOly.Panorama_mode = get2();
255   	imOly.Panorama_frameNum = get2();
256   	break;
257   case 0x0604:
258     imgdata.shootinginfo.ImageStabilization = get4();
259     break;
260   case 0x0804:
261     imOly.StackedImage[0] = get4();
262     imOly.StackedImage[1] = get4();
263     if (imOly.StackedImage[0] == 3) {
264       imOly.isLiveND = 1;
265       imOly.LiveNDfactor = imOly.StackedImage[1];
266     } else {
267       imOly.isLiveND = 0;
268     }
269     break;
270   }
271 
272   return;
273 }
274 
parseOlympus_ImageProcessing(unsigned tag,unsigned type,unsigned len,unsigned dng_writer)275 void LibRaw::parseOlympus_ImageProcessing(unsigned tag, unsigned type,
276                                           unsigned len, unsigned dng_writer)
277 {
278   // uptag 0x2040
279 
280   int i, c, wb[4], nWB, tWB, wbG;
281   ushort CT;
282   short sorder;
283 
284   if ((tag == 0x0100) && (dng_writer == nonDNG))
285   {
286     cam_mul[0] = get2() / 256.0;
287     cam_mul[2] = get2() / 256.0;
288   }
289   else if ((tag == 0x0101) && (len == 2) &&
290            ((OlyID == OlyID_E_410) || (OlyID == OlyID_E_510)))
291   {
292     for (i = 0; i < 64; i++)
293     {
294       icWBCCTC[i][2] = icWBCCTC[i][4] = icWBC[i][1] = icWBC[i][3] = 0x100;
295     }
296     for (i = 64; i < 256; i++)
297     {
298       icWBC[i][1] = icWBC[i][3] = 0x100;
299     }
300   }
301   else if ((tag > 0x0101) && (tag <= 0x0111))
302   {
303     nWB = tag - 0x0101;
304     tWB = Oly_wb_list2[nWB << 1];
305     CT = Oly_wb_list2[(nWB << 1) | 1];
306     wb[0] = get2();
307     wb[2] = get2();
308     if (tWB != 0x100)
309     {
310       icWBC[tWB][0] = wb[0];
311       icWBC[tWB][2] = wb[2];
312     }
313     if (CT)
314     {
315       icWBCCTC[nWB - 1][0] = CT;
316       icWBCCTC[nWB - 1][1] = wb[0];
317       icWBCCTC[nWB - 1][3] = wb[2];
318     }
319     if (len == 4)
320     {
321       wb[1] = get2();
322       wb[3] = get2();
323       if (tWB != 0x100)
324       {
325         icWBC[tWB][1] = wb[1];
326         icWBC[tWB][3] = wb[3];
327       }
328       if (CT)
329       {
330         icWBCCTC[nWB - 1][2] = wb[1];
331         icWBCCTC[nWB - 1][4] = wb[3];
332       }
333     }
334   }
335   else if ((tag >= 0x0112) && (tag <= 0x011e))
336   {
337     nWB = tag - 0x0112;
338     wbG = get2();
339     tWB = Oly_wb_list2[nWB << 1];
340     if (nWB)
341       icWBCCTC[nWB - 1][2] = icWBCCTC[nWB - 1][4] = wbG;
342     if (tWB != 0x100)
343       icWBC[tWB][1] = icWBC[tWB][3] = wbG;
344   }
345   else if (tag == 0x011f)
346   {
347     wbG = get2();
348     if (icWBC[LIBRAW_WBI_Flash][0])
349       icWBC[LIBRAW_WBI_Flash][1] =
350           icWBC[LIBRAW_WBI_Flash][3] = wbG;
351     FORC4 if (icWBC[LIBRAW_WBI_Custom1 + c][0])
352         icWBC[LIBRAW_WBI_Custom1 + c][1] =
353         icWBC[LIBRAW_WBI_Custom1 + c][3] = wbG;
354   }
355   else if (tag == 0x0121)
356   {
357     icWBC[LIBRAW_WBI_Flash][0] = get2();
358     icWBC[LIBRAW_WBI_Flash][2] = get2();
359     if (len == 4)
360     {
361       icWBC[LIBRAW_WBI_Flash][1] = get2();
362       icWBC[LIBRAW_WBI_Flash][3] = get2();
363     }
364   }
365   else if ((tag == 0x0200) && (dng_writer == nonDNG) &&
366            strcmp(software, "v757-71"))
367   {
368     for (i = 0; i < 3; i++)
369     {
370       if (!imOly.ColorSpace)
371       {
372         FORC3 cmatrix[i][c] = ((short)get2()) / 256.0;
373       }
374       else
375       {
376         FORC3 imgdata.color.ccm[i][c] = ((short)get2()) / 256.0;
377       }
378     }
379   }
380   else if ((tag == 0x0600) && (dng_writer == nonDNG))
381   {
382     FORC4 cblack[RGGB_2_RGBG(c)] = get2();
383   }
384   else if ((tag == 0x0611) && (dng_writer == nonDNG))
385   {
386      imOly.ValidBits = get2();
387   }
388   else if ((tag == 0x0612) && (dng_writer == nonDNG))
389   {
390     imgdata.sizes.raw_inset_crops[0].cleft = get2();
391   }
392   else if ((tag == 0x0613) && (dng_writer == nonDNG))
393   {
394     imgdata.sizes.raw_inset_crops[0].ctop = get2();
395   }
396   else if ((tag == 0x0614) && (dng_writer == nonDNG))
397   {
398     imgdata.sizes.raw_inset_crops[0].cwidth = get2();
399   }
400   else if ((tag == 0x0615) && (dng_writer == nonDNG))
401   {
402     imgdata.sizes.raw_inset_crops[0].cheight = get2();
403   }
404   else if ((tag == 0x0805) && (len == 2))
405   {
406     imOly.SensorCalibration[0] = getreal(type);
407     imOly.SensorCalibration[1] = getreal(type);
408     if ((dng_writer == nonDNG) && (OlyID != OlyID_XZ_1))
409       FORC4 imgdata.color.linear_max[c] = imOly.SensorCalibration[0];
410   }
411   else if (tag == 0x1112)
412   {
413     sorder = order;
414     order = 0x4d4d;
415     c = get2();
416     order = sorder;
417     switch (c) {
418     case 0x0101:
419     case 0x0901:
420     case 0x0909:
421       imgdata.sizes.raw_aspect = LIBRAW_IMAGE_ASPECT_4to3;
422       break;
423     case 0x0104:
424     case 0x0401:
425       imgdata.sizes.raw_aspect = LIBRAW_IMAGE_ASPECT_1to1;
426       break;
427     case 0x0201:
428     case 0x0202:
429       imgdata.sizes.raw_aspect = LIBRAW_IMAGE_ASPECT_3to2;
430       break;
431     case 0x0301:
432     case 0x0303:
433       imgdata.sizes.raw_aspect = LIBRAW_IMAGE_ASPECT_16to9;
434       break;
435     case 0x0404:
436 //      imgdata.sizes.raw_aspect = LIBRAW_IMAGE_ASPECT_6to6;
437         imgdata.sizes.raw_aspect = LIBRAW_IMAGE_ASPECT_1to1;
438       break;
439     case 0x0505:
440       imgdata.sizes.raw_aspect = LIBRAW_IMAGE_ASPECT_5to4;
441       break;
442     case 0x0606:
443       imgdata.sizes.raw_aspect = LIBRAW_IMAGE_ASPECT_7to6;
444       break;
445     case 0x0707:
446       imgdata.sizes.raw_aspect = LIBRAW_IMAGE_ASPECT_6to5;
447       break;
448     case 0x0808:
449       imgdata.sizes.raw_aspect = LIBRAW_IMAGE_ASPECT_7to5;
450       break;
451     default:
452       imgdata.sizes.raw_aspect = LIBRAW_IMAGE_ASPECT_OTHER;
453       break;
454     }
455   }
456   else if (tag == 0x1113)
457   {
458     imOly.AspectFrame[0] = get2();
459     imOly.AspectFrame[1] = get2();
460     imOly.AspectFrame[2] = get2();
461     imOly.AspectFrame[3] = get2();
462   }
463   else if (tag == 0x1306)
464   {
465     c = get2();
466     if ((c != 0) && (c != 100))
467     {
468       if (c < 61)
469         imCommon.CameraTemperature = (float)c;
470       else
471         imCommon.CameraTemperature = (float)(c - 32) / 1.8f;
472       if ((imCommon.exifAmbientTemperature > -273.15f) &&
473           ((OlyID == OlyID_TG_5) ||
474            (OlyID == OlyID_TG_6))
475       )
476         imCommon.CameraTemperature += imCommon.exifAmbientTemperature;
477     }
478   }
479 
480   return;
481 }
482 
parseOlympus_RawInfo(unsigned tag,unsigned type,unsigned len,unsigned dng_writer)483 void LibRaw::parseOlympus_RawInfo(unsigned tag, unsigned type, unsigned len,
484                                   unsigned dng_writer)
485 {
486   // uptag 0x3000
487 
488   int wb_ind, c, i;
489 
490   if ((tag == 0x0110) && strcmp(software, "v757-71"))
491   {
492     icWBC[LIBRAW_WBI_Auto][0] = get2();
493     icWBC[LIBRAW_WBI_Auto][2] = get2();
494     if (len == 2)
495     {
496       for (i = 0; i < 256; i++)
497         icWBC[i][1] = icWBC[i][3] = 0x100;
498     }
499   }
500   else if ((((tag >= 0x0120) && (tag <= 0x0124)) ||
501             ((tag >= 0x0130) && (tag <= 0x0133))) &&
502            strcmp(software, "v757-71"))
503   {
504     if (tag <= 0x0124)
505       wb_ind = tag - 0x0120;
506     else
507       wb_ind = tag - 0x0130 + 5;
508 
509     icWBC[Oly_wb_list1[wb_ind]][0] = get2();
510     icWBC[Oly_wb_list1[wb_ind]][2] = get2();
511   }
512   else if ((tag == 0x0200) && (dng_writer == nonDNG))
513   {
514     for (i = 0; i < 3; i++)
515     {
516       if (!imOly.ColorSpace)
517       {
518         FORC3 cmatrix[i][c] = ((short)get2()) / 256.0;
519       }
520       else
521       {
522         FORC3 imgdata.color.ccm[i][c] = ((short)get2()) / 256.0;
523       }
524     }
525   }
526   else if ((tag == 0x0600) && (dng_writer == nonDNG))
527   {
528     FORC4 cblack[RGGB_2_RGBG(c)] = get2();
529   }
530   else if ((tag == 0x0612) && (dng_writer == nonDNG))
531   {
532     imgdata.sizes.raw_inset_crops[0].cleft = get2();
533   }
534   else if ((tag == 0x0613) && (dng_writer == nonDNG))
535   {
536     imgdata.sizes.raw_inset_crops[0].ctop = get2();
537   }
538   else if ((tag == 0x0614) && (dng_writer == nonDNG))
539   {
540     imgdata.sizes.raw_inset_crops[0].cwidth = get2();
541   }
542   else if ((tag == 0x0615) && (dng_writer == nonDNG))
543   {
544     imgdata.sizes.raw_inset_crops[0].cheight = get2();
545   }
546   return;
547 }
548 
549 
parseOlympusMakernotes(int base,unsigned tag,unsigned type,unsigned len,unsigned dng_writer)550 void LibRaw::parseOlympusMakernotes (int base, unsigned tag, unsigned type, unsigned len, unsigned dng_writer) {
551 
552   int c;
553   unsigned a;
554   if ((tag >= 0x20100000) && (tag <= 0x2010ffff)) {
555         parseOlympus_Equipment((tag & 0x0000ffff), type, len, dng_writer);
556 
557   } else if ((tag >= 0x20200000) && (tag <= 0x2020ffff)) {
558     parseOlympus_CameraSettings(base, (tag & 0x0000ffff), type, len, dng_writer);
559 
560   } else if ((tag >= 0x20400000) && (tag <= 0x2040ffff)) {
561      parseOlympus_ImageProcessing((tag & 0x0000ffff), type, len, dng_writer);
562 
563   } else if ((tag >= 0x30000000) && (tag <= 0x3000ffff)) {
564         parseOlympus_RawInfo((tag & 0x0000ffff), type, len, dng_writer);
565 
566   } else {
567 		switch (tag) {
568 			case 0x0200:
569 			  FORC3 if ((imOly.SpecialMode[c] = get4()) >= 0xff) imOly.SpecialMode[c] = 0xffffffff;
570 			  break;
571 			case 0x0207:
572 				getOlympus_CameraType2();
573 				break;
574 			case 0x0404:
575 			case 0x101a:
576 				if (!imgdata.shootinginfo.BodySerial[0] && (dng_writer == nonDNG))
577 					stmread(imgdata.shootinginfo.BodySerial, len, ifp);
578 				break;
579 			case 0x1002:
580 				ilm.CurAp = libraw_powf64l(2.0f, getreal(type) / 2);
581 				break;
582 			case 0x1007:
583 				imCommon.SensorTemperature = (float)get2();
584 				break;
585 			case 0x1008:
586 				imCommon.LensTemperature = (float)get2();
587 				break;
588 			case 0x100b:
589 				if (imOly.FocusMode[0] == 0xffff) {
590 					imgdata.shootinginfo.FocusMode = imOly.FocusMode[0] = get2();
591 					if (imgdata.shootinginfo.FocusMode == 1)
592 						imgdata.shootinginfo.FocusMode = imOly.FocusMode[0] = 10;
593 				}
594 				break;
595       case 0x100d:
596         if (imOly.ZoomStepCount == 0xffff) imOly.ZoomStepCount = get2();
597         break;
598       case 0x100e:
599         if (imOly.FocusStepCount == 0xffff) imOly.FocusStepCount = get2();
600         break;
601 			case 0x1011:
602 				if (strcmp(software, "v757-71") && (dng_writer == nonDNG)) {
603 					for (int i = 0; i < 3; i++) {
604 						if (!imOly.ColorSpace) {
605 							FORC3 cmatrix[i][c] = ((short)get2()) / 256.0;
606 						} else {
607 							FORC3 imgdata.color.ccm[i][c] = ((short)get2()) / 256.0;
608 						}
609 					}
610 				}
611 				break;
612 			case 0x1012:
613 			  if (dng_writer == nonDNG)
614 				  FORC4 cblack[RGGB_2_RGBG(c)] = get2();
615 				break;
616 			case 0x1017:
617 				if (dng_writer == nonDNG)
618 				  cam_mul[0] = get2() / 256.0;
619 				break;
620 			case 0x1018:
621 				if (dng_writer == nonDNG)
622 				  cam_mul[2] = get2() / 256.0;
623 				break;
624 			case 0x102c:
625 				if (dng_writer == nonDNG)
626 				  imOly.ValidBits = get2();
627 				break;
628 			case 0x1038:
629 				imOly.AFResult = get2();
630 				break;
631       case 0x103b:
632         if (imOly.FocusStepInfinity == 0xffff) imOly.FocusStepInfinity = get2();
633         break;
634       case 0x103c:
635         if (imOly.FocusStepNear == 0xffff) imOly.FocusStepNear = get2();
636         break;
637 			case 0x20300108:
638 			case 0x20310109:
639 				if (dng_writer == nonDNG) {
640           imOly.ColorSpace = get2();
641           switch (imOly.ColorSpace) {
642           case 0:
643             imCommon.ColorSpace = LIBRAW_COLORSPACE_sRGB;
644             break;
645           case 1:
646             imCommon.ColorSpace = LIBRAW_COLORSPACE_AdobeRGB;
647             break;
648           case 2:
649             imCommon.ColorSpace = LIBRAW_COLORSPACE_ProPhotoRGB;
650             break;
651           default:
652             imCommon.ColorSpace = LIBRAW_COLORSPACE_Unknown;
653             break;
654           }
655 				}
656 			case 0x20500209:
657 				imOly.AutoFocus = get2();
658 				break;
659 			case 0x20500300:
660 			  imOly.ZoomStepCount = get2();
661 			  break;
662 			case 0x20500301:
663 			  imOly.FocusStepCount = get2();
664 			  break;
665 			case 0x20500303:
666 			  imOly.FocusStepInfinity = get2();
667 			  break;
668 			case 0x20500304:
669 			  imOly.FocusStepNear = get2();
670 			  break;
671 			case 0x20500305:
672 			  a = get4();
673 			  /*b = */ get4(); // b is not used, so removed
674 			  if (a >= 0x7f000000) imOly.FocusDistance = -1.0; // infinity
675 			  else imOly.FocusDistance = (double) a / 1000.0;  // convert to meters
676 			  break;
677 			case 0x20500308:
678 				imOly.AFPoint = get2();
679 				break;
680 			case 0x20501500:
681 				getOlympus_SensorTemperature(len);
682 				break;
683 		}
684   }
685 }
686