From 399a642cf2e2900d1df80ff2da5a6f526dac47d54bafe457469907eeadec5214 Mon Sep 17 00:00:00 2001 From: OBS User autobuild Date: Wed, 5 May 2010 20:19:04 +0000 Subject: [PATCH] Accepting request 39408 from graphics Copy from graphics/dcraw based on submit request 39408 from user bruclik OBS-URL: https://build.opensuse.org/request/show/39408 OBS-URL: https://build.opensuse.org/package/show/openSUSE:Factory/dcraw?expand=0&rev=11 --- README | 461 +++++++++++++++++++++++---------------------- dcraw-omp.patch | 20 +- dcraw.c | 482 ++++++++++++++++++++++++++++++------------------ dcraw.changes | 14 ++ dcraw.spec | 4 +- parse.c | 5 +- 6 files changed, 577 insertions(+), 409 deletions(-) diff --git a/README b/README index 860ea11..47654e5 100644 --- a/README +++ b/README @@ -70,7 +70,7 @@ http://www.cybercom.net/~dcoffin/dcraw/: execute permission. * [17]dcraw.c -- decodes raw photos, extracts thumbnails, and displays metadata - Supports 336 cameras at last count. Compile with "gcc -o dcraw -O4 + Supports 361 cameras at last count. Compile with "gcc -o dcraw -O4 dcraw.c -lm -ljpeg -llcms" or "gcc -o dcraw -O4 dcraw.c -lm -DNO_JPEG -DNO_LCMS". Run with no arguments to see a usage message. Don't complain that 16-bit output is too dark -- read the [18]FAQ! @@ -112,13 +112,14 @@ http://www.cybercom.net/~dcoffin/dcraw/: currently supported languages are [33]Esperanto, [34]Russian, [35]French, [36]Italian, [37]German, [38]Portuguese, [39]Spanish, [40]Dutch, [41]Polish, [42]Hungarian, [43]Czech, [44]Swedish, - [45]Catalan, and Chinese (both [46]Traditional and [47]Simplified). + [45]Catalan, [46]Danish, and Chinese (both [47]Traditional and + [48]Simplified). To build a unilingual, self-contained DCRAW.EXE for DOS/Windows, use a - source file [48]from this directory instead. + source file [49]from this directory instead. - To add another language, send me translations of [49]this manpage and - [50]this message table in UTF-8 encoding. Translate only from my + To add another language, send me translations of [50]this manpage and + [51]this message table in UTF-8 encoding. Translate only from my original English and Esperanto texts -- other languages may contain factual errors invisible to me. @@ -149,113 +150,113 @@ http://www.cybercom.net/~dcoffin/dcraw/: digital cameras in their applications. They can call dcraw from a graphical interface, paste pieces of dcraw.c into their code, or just use dcraw.c as the documentation that camera makers refuse to provide: - * [51]ACDSee - * [52]Adobe Photoshop - * [53]BR's PhotoArchiver by Baard Riiber - * [54]BreezeBrowser by Chris Breeze - * [55]Conceiva Lightbox - * [56]cPicture by Juergen Eidt - * [57]Cumulus by Canto - * [58]dcRAW-X by Bryan Chang - * [59]DCRawUI by Sune Trudslev - * [60]Directory Opus Plugin by Leo Davidson(with C++ source code) - * [61]DeepSkyStacker by Luc Coiffier - * [62]dpMagic by Mikhail Stolpner - * [63]DRIFTT by Andrew Long - * [64]EasyRaw Studio - * [65]GraphicConverter by Thorsten Lemke - * [66]GVBox from JCO Consulting - * [67]HDR Shop - * [68]ImageLab from Aragon System - * [69]Imagina by Rob Baker - * [70]IrfanView by Irfan Skiljan - * [71]IRIS image processor for astronomers - * [72]KA Photoservice - * [73]Lightbox by Josh Anon - * [74]LightZone by Anton Kast - * [75]LRViewer by Marc Rochkind - * [76]MediaRECOVER File Recovery Software - * [77]Mixpo by Mixpo Portfolio Broadcasting Inc. - * [78]Photo Acute by Almalence - * [79]Photo Companion by Jeff Moore - * [80]Photo Jockey by Davie Lee Reed who also wrote a [81]dcraw + * [52]ACDSee + * [53]Adobe Photoshop + * [54]BR's PhotoArchiver by Baard Riiber + * [55]BreezeBrowser by Chris Breeze + * [56]Conceiva Lightbox + * [57]cPicture by Juergen Eidt + * [58]Cumulus by Canto + * [59]dcRAW-X by Bryan Chang + * [60]DCRawUI by Sune Trudslev + * [61]Directory Opus Plugin by Leo Davidson(with C++ source code) + * [62]DeepSkyStacker by Luc Coiffier + * [63]dpMagic by Mikhail Stolpner + * [64]DRIFTT by Andrew Long + * [65]EasyRaw Studio + * [66]GraphicConverter by Thorsten Lemke + * [67]GVBox from JCO Consulting + * [68]HDR Shop + * [69]ImageLab from Aragon System + * [70]Imagina by Rob Baker + * [71]IrfanView by Irfan Skiljan + * [72]IRIS image processor for astronomers + * [73]KA Photoservice + * [74]Lightbox by Josh Anon + * [75]LightZone by Anton Kast + * [76]LRViewer by Marc Rochkind + * [77]MediaRECOVER File Recovery Software + * [78]Mixpo by Mixpo Portfolio Broadcasting Inc. + * [79]Photo Acute by Almalence + * [80]Photo Companion by Jeff Moore + * [81]Photo Jockey by Davie Lee Reed who also wrote a [82]dcraw interface for Delphi programmers. - * [82]Photo Organizer by Balint Kis - * [83]PhotoRescue from DataRescue - * [84]PhotoReviewer by Ben Haller - * [85]Photovault by Harri Kaimio - * [86]Picasa from Google - * [87]Picture Arena by Felix Schwarz - * [88]PixInsight by Pleiades Software - * [89]PiXPO by PiXPO Inc. - * [90]PolyView by Polybytes - * [91]PowerShovel-II by Luc Minnebo - * [92]RAW Developer by Iridient Digital - * [93]Raw Magick - * [94]RawConvert by Jason Swain - * [95]RawDrop by Frank Siegert - * [96]RawShooter from pixmantec - * [97]RawTherapee by RT Team - * [98]RawView by Jari Savolainen - * [99]Serif PhotoPlus, PanoramaPlus, and AlbumPlus - * [100]SharpRaw by Duane DeSieno - * [101]SilverFast DCPro by LaserSoft Imaging - * [102]StudioLine Photo by H&M Software - * [103]ViewIt by Zdzislaw Losvik - * [104]Viewer n5 by Dmitry Fedorov - * [105]VueScan by Ed Hamrick - * [106]Xara Xtreme Pro + * [83]Photo Organizer by Balint Kis + * [84]PhotoRescue from DataRescue + * [85]PhotoReviewer by Ben Haller + * [86]Photovault by Harri Kaimio + * [87]Picasa from Google + * [88]Picture Arena by Felix Schwarz + * [89]PixInsight by Pleiades Software + * [90]PiXPO by PiXPO Inc. + * [91]PolyView by Polybytes + * [92]PowerShovel-II by Luc Minnebo + * [93]RAW Developer by Iridient Digital + * [94]Raw Magick + * [95]RawConvert by Jason Swain + * [96]RawDrop by Frank Siegert + * [97]RawShooter from pixmantec + * [98]RawTherapee by RT Team + * [99]RawView by Jari Savolainen + * [100]Serif PhotoPlus, PanoramaPlus, and AlbumPlus + * [101]SharpRaw by Duane DeSieno + * [102]SilverFast DCPro by LaserSoft Imaging + * [103]StudioLine Photo by H&M Software + * [104]ViewIt by Zdzislaw Losvik + * [105]Viewer n5 by Dmitry Fedorov + * [106]VueScan by Ed Hamrick + * [107]Xara Xtreme Pro Frequently Asked Questions I don't have a C compiler. Could you send me an executable? No, but Francisco Montilla provides Mac OS and Windows - executables [107]on his website. And Benjamin Lebsanft has - volunteered to maintain [108]Windows executables optimized for - specific CPUs. Dcraw has also been ported to [109]Amiga, - [110]MorphOS, [111]BeOS, [112]OS/2, and [113]RISC OS. + executables [108]on his website. And Manuel Llorens has provided + a [109]huge cache of Windows executables here. Dcraw has also + been ported to [110]Amiga, [111]MorphOS, [112]BeOS, [113]OS/2, + and [114]RISC OS. If you're familiar with the DOS command line but don't know C, - you can install this [114]free C compiler for Windows and + you can install this [115]free C compiler for Windows and compile dcraw.c quite easily. Why does dcraw say "Out of memory" in Windows Vista? This is an arbitrary limitation of Windows Vista that will be fixed in Service Pack 1. Thomas Nicely (of Pentium FDIV fame) - has a [115]page describing the problem. At the moment, the only + has a [116]page describing the problem. At the moment, the only workaround is to build dcraw.exe with a Microsoft compiler instead of a GNU compiler. How can I read the EXIF data (shutter speed, aperture, etc.)? - [116]Phil Harvey's ExifTool provides a unified Perl-based EXIF + [117]Phil Harvey's ExifTool provides a unified Perl-based EXIF reader (and editor!) for all cameras and file formats. "dcraw -i -v" is much faster, but provides less information. How can I read NEF files from Nikon scanners? - Dcraw only supports cameras. Try [117]this simple program for + Dcraw only supports cameras. Try [118]this simple program for scanners. How can I read Nikon Dust Off images (NDF files)? - [118]Use this program. + [119]Use this program. Do you have any specifications describing raw photo formats? Yes, but they tend to omit important details, like how to decompress the raw image or decrypt private metadata. See the - [119]TIFF spec, the [120]TIFF/EP spec, the [121]Adobe DNG spec, - the [122]CIFF (CRW) spec, and the [123]X3F spec. + [120]TIFF spec, the [121]TIFF/EP spec, the [122]Adobe DNG spec, + the [123]CIFF (CRW) spec, and the [124]X3F spec. Where can I get an assortment of raw photos to test my software? - Try [124]raw.fotosite.pl, [125]www.rawsamples.ch, and [126]Glass - Lantern RAWpository. A "full review" at [127]Imaging Resource + Try [125]raw.fotosite.pl, [126]www.rawsamples.ch, and [127]Glass + Lantern RAWpository. A "full review" at [128]Imaging Resource usually includes a few raw shots. For the complete dcraw test suite (every camera supported by dcraw), I sell a 3-DVD set for $700 and web-based updates for $300/year. I'm designing a digital camera. How do I convert its raw photos into something that dcraw and Adobe Photoshop can open? - Download [128]LibTIFF v3.8.2 and apply [129]this patch. Then use - [130]this C program as a template for converting your photos to - valid [131]Adobe DNG files. + Download [129]LibTIFF v3.8.2 and apply [130]this patch. Then use + [131]this C program as a template for converting your photos to + valid [132]Adobe DNG files. Why are dcraw output images larger than camera JPEGs? Any algorithm that combines each pixel with its neighbors is @@ -276,11 +277,11 @@ http://www.cybercom.net/~dcoffin/dcraw/: Why is 16-bit output dark / unreadable? If you want pretty pictures straight out of dcraw, stay with 8-bit output. 16-bit linear output is the best raw material for - professional image editors such as [132]Photoshop and - [133]CinePaint, but it's no good for most image viewers. + professional image editors such as [133]Photoshop and + [134]CinePaint, but it's no good for most image viewers. What does the "-f" (four color RGB) option do? - If you see patterns like [134]this or [135]this in your output + If you see patterns like [135]this or [136]this in your output images, first try "dcraw -a". If these patterns persist, use "dcraw -f" to get rid of them. @@ -294,8 +295,8 @@ dcraw -c crw_0001.crw | pnmtopng > crw_0001.png dcraw -c crw_0001.crw | ppmtobmp > crw_0001.bmp dcraw -c crw_0001.crw | cjpeg > crw_0001.jpeg - I used the [136]Netpbm toolkit in these examples. - [137]ImageMagick also does command-line format conversions. Both + I used the [137]Netpbm toolkit in these examples. + [138]ImageMagick also does command-line format conversions. Both are free. Why don't you implement dcraw as a library? @@ -309,7 +310,7 @@ dcraw -c crw_0001.crw | cjpeg > crw_0001.jpeg formats that change every day. There's a simpler way to make dcraw modular and thread-safe: Run - it as a separate process. Eric Raymond [138]explains this + it as a separate process. Eric Raymond [139]explains this technique here. Why are there false colors along edges within the image? @@ -325,7 +326,7 @@ dcraw -c crw_0001.crw | cjpeg > crw_0001.jpeg Variable Number of Gradients (VNG), Patterned Pixel Grouping (PPG), and Adaptive Homogeneity-Directed (AHD). - [139]The Foveon X3 Capture chip requires a different kind of + [140]The Foveon X3 Capture chip requires a different kind of interpolation. Unlike CCD arrays, it captures three colors at every pixel location. But the colors are not well separated, so the raw data looks very gray. Much processing is needed to @@ -333,17 +334,17 @@ dcraw -c crw_0001.crw | cjpeg > crw_0001.jpeg How do I get my camera to take raw photos? For Canon PowerShots that don't output CRW or CR2, you need the - [140]CHDK hack. + [141]CHDK hack. For some Nikon Coolpix cameras, you need to enable a - [141]special "DIAG RAW" mode. - For Casio cameras, see [142]Maurice Delaney's website or read - [143]this discussion on dpreview. - For the Minolta DiMAGE G400, G500, G530, or G600, go [144]here - (in Russian) or [145]here (in English). + [142]special "DIAG RAW" mode. + For Casio cameras, see [143]Maurice Delaney's website or read + [144]this discussion on dpreview. + For the Minolta DiMAGE G400, G500, G530, or G600, go [145]here + (in Russian) or [146]here (in English). For the Minolta DiMAGE Z2 and Nikon Coolpix 2100/3100/3700, - [146]go here. - For SMaL cameras, see the [147]camerahacking Forum. - For Agfa and Samsung cameras, [148]go here. + [147]go here. + For SMaL cameras, see the [148]camerahacking Forum. + For Agfa and Samsung cameras, [149]go here. For other cameras, refer to the User's Manual. @@ -351,16 +352,16 @@ dcraw -c crw_0001.crw | cjpeg > crw_0001.jpeg Most likely, yes. If your camera is not on the Supported list, try dcraw anyway. If it doesn't work, post a raw image to a website and e-mail me the URL. If you don't have a website, use - [149]YouSendIt, [150]RapidShare, [151]Sendshack, [152]ShareFile, - [153]sendspace, [154]File-Upload, or [155]Megaupload. + [150]YouSendIt, [151]RapidShare, [152]Sendshack, [153]ShareFile, + [154]sendspace, [155]File-Upload, or [156]Megaupload. Before choosing a photo to send, read the next question: Why does dcraw output have a green tint and weak color? Because dcraw doesn't have a color matrix for your camera model, it outputs raw color instead of sRGB. To fix this, I need a - photo of a [156]Wolf Faust, [157]Calibr8, [158]CMP, - [159]GretagMacbeth, or other calibrated color chart. Follow this + photo of a [157]Wolf Faust, [158]Calibr8, [159]CMP, + [160]GretagMacbeth, or other calibrated color chart. Follow this checklist: + Use a real chart, not a printout or screen image. @@ -388,6 +389,7 @@ dcraw -c crw_0001.crw | cjpeg > crw_0001.jpeg * Canon PowerShot A5 Zoom * Canon PowerShot A50 * Canon PowerShot A460 (CHDK hack) + * Canon PowerShot A470 (CHDK hack) * Canon PowerShot A530 (CHDK hack) * Canon PowerShot A570 (CHDK hack) * Canon PowerShot A590 (CHDK hack) @@ -409,6 +411,7 @@ dcraw -c crw_0001.crw | cjpeg > crw_0001.jpeg * Canon PowerShot G7 (CHDK hack) * Canon PowerShot G9 * Canon PowerShot G10 + * Canon PowerShot G11 * Canon PowerShot S2 IS (CHDK hack) * Canon PowerShot S3 IS (CHDK hack) * Canon PowerShot S5 IS (CHDK hack) @@ -419,12 +422,14 @@ dcraw -c crw_0001.crw | cjpeg > crw_0001.jpeg * Canon PowerShot S50 * Canon PowerShot S60 * Canon PowerShot S70 + * Canon PowerShot S90 * Canon PowerShot SX1 IS * Canon PowerShot SX110 IS (CHDK hack) * Canon EOS D30 * Canon EOS D60 * Canon EOS 5D * Canon EOS 5D Mark II + * Canon EOS 7D * Canon EOS 10D * Canon EOS 20D * Canon EOS 30D @@ -440,8 +445,9 @@ dcraw -c crw_0001.crw | cjpeg > crw_0001.jpeg * Canon EOS-1D * Canon EOS-1DS * Canon EOS-1D Mark II - * Canon EOS-1D Mark III * Canon EOS-1D Mark II N + * Canon EOS-1D Mark III + * Canon EOS-1D Mark IV * Canon EOS-1Ds Mark II * Canon EOS-1Ds Mark III * Casio QV-2000UX @@ -457,6 +463,10 @@ dcraw -c crw_0001.crw | cjpeg > crw_0001.jpeg * Casio EX-Z4 * Casio EX-Z50 * Casio EX-Z55 + * Casio EX-Z60 + * Casio EX-Z75 + * Casio EX-Z750 + * Casio EX-Z850 * Casio Exlim Pro 505 * Casio Exlim Pro 600 * Casio Exlim Pro 700 @@ -482,6 +492,7 @@ dcraw -c crw_0001.crw | cjpeg > crw_0001.jpeg * Fuji FinePix S7000 * Fuji FinePix S9000/S9500 * Fuji FinePix S9100/S9600 + * Fuji FinePix S200EXR * Fuji IS-1 * Hasselblad CFV * Hasselblad H3D @@ -490,11 +501,11 @@ dcraw -c crw_0001.crw | cjpeg > crw_0001.jpeg * Imacon Ixpress 22-megapixel * Imacon Ixpress 39-megapixel * ISG 2020x1520 - * Kodak DC20 (see [160]Oliver Hartman's page) - * Kodak DC25 (see [161]Jun-ichiro Itoh's page) + * Kodak DC20 (see [161]Oliver Hartman's page) + * Kodak DC25 (see [162]Jun-ichiro Itoh's page) * Kodak DC40 * Kodak DC50 - * Kodak DC120 (also try [162]kdc2tiff) + * Kodak DC120 (also try [163]kdc2tiff) * Kodak DCS200 * Kodak DCS315C * Kodak DCS330C @@ -525,6 +536,7 @@ dcraw -c crw_0001.crw | cjpeg > crw_0001.jpeg * Kodak C603 * Kodak P850 * Kodak P880 + * Kodak Z980 * Kodak Z1015 * Kodak KAI-0340 * Konica KD-400Z @@ -590,7 +602,10 @@ dcraw -c crw_0001.crw | cjpeg > crw_0001.jpeg * Nikon D100 * Nikon D200 * Nikon D300 + * Nikon D300s * Nikon D700 + * Nikon D3000 + * Nikon D5000 * Nikon E700 ("DIAG RAW" hack) * Nikon E800 ("DIAG RAW" hack) * Nikon E880 ("DIAG RAW" hack) @@ -621,6 +636,7 @@ dcraw -c crw_0001.crw | cjpeg > crw_0001.jpeg * Olympus C740UZ * Olympus C770UZ * Olympus C8080WZ + * Olympus X200,D560Z,C350Z * Olympus E-1 * Olympus E-3 * Olympus E-10 @@ -634,6 +650,8 @@ dcraw -c crw_0001.crw | cjpeg > crw_0001.jpeg * Olympus E-500 * Olympus E-510 * Olympus E-520 + * Olympus E-620 + * Olympus E-P1 * Olympus SP310 * Olympus SP320 * Olympus SP350 @@ -646,6 +664,7 @@ dcraw -c crw_0001.crw | cjpeg > crw_0001.jpeg * Panasonic DMC-FZ18 * Panasonic DMC-FZ28 * Panasonic DMC-FZ30 + * Panasonic DMC-FZ35/FZ38 * Panasonic DMC-FZ50 * Panasonic DMC-FX150 * Panasonic DMC-G1 @@ -667,6 +686,8 @@ dcraw -c crw_0001.crw | cjpeg > crw_0001.jpeg * Pentax K100D Super * Pentax K200D * Pentax K2000/K-m + * Pentax K-x + * Pentax K-7 * Pentax Optio S * Pentax Optio S4 * Pentax Optio 33WR @@ -705,8 +726,13 @@ dcraw -c crw_0001.crw | cjpeg > crw_0001.jpeg * Sony DSLR-A100 * Sony DSLR-A200 * Sony DSLR-A300 + * Sony DSLR-A330 * Sony DSLR-A350 + * Sony DSLR-A380 + * Sony DSLR-A500 + * Sony DSLR-A550 * Sony DSLR-A700 + * Sony DSLR-A850 * Sony DSLR-A900 * Sony XCD-SX910CR * STV680 VGA @@ -759,120 +785,121 @@ References 43. http://www.cybercom.net/~dcoffin/dcraw/dcraw_cs.1.html 44. http://www.cybercom.net/~dcoffin/dcraw/dcraw_sv.1.html 45. http://www.cybercom.net/~dcoffin/dcraw/dcraw_ca.1.html - 46. http://www.cybercom.net/~dcoffin/dcraw/dcraw_zh_TW.1.html - 47. http://www.cybercom.net/~dcoffin/dcraw/dcraw_zh_CN.1.html - 48. http://www.cybercom.net/~dcoffin/dcraw/msdos/ - 49. http://www.cybercom.net/~dcoffin/dcraw/dcraw.1 - 50. http://www.cybercom.net/~dcoffin/dcraw/dcraw_eo.po - 51. http://www.acdsystems.com/ - 52. http://www.adobe.com/products/photoshop/cameraraw.html - 53. http://www.br-software.com/ - 54. http://www.breezesys.com/ - 55. http://www.conceiva.com/ - 56. http://cpicture.net/en/t_raw.html - 57. http://www.canto.com/ - 58. http://frostyplace.com/dcraw/ - 59. http://www.tanis.dk/wiki/index.php/DCRawUI - 60. http://www.pretentiousname.com/jp2raw/ - 61. http://deepskystacker.free.fr/ - 62. http://www.dpmagic.com/ - 63. http://www.nla.gov.au/preserve/dohm/driftt.html - 64. http://www.easyraw.com/ - 65. http://www.lemkesoft.com/ - 66. http://jcoconsulting.com/index.asp?Section=GVOCX - 67. http://www.hdrshop.com/ - 68. http://www.aragonsystem.com/ - 69. http://www.planetimagina.com/ - 70. http://www.irfanview.com/ - 71. http://www.astrosurf.com/buil/us/iris/iris.htm - 72. http://www.kaorg.com/photoservice.asp - 73. http://www.lightboxsoftware.com/ - 74. http://sonic.net/~rat/lightcrafts/ - 75. http://imageingester.com/ - 76. http://www.mediarecover.com/ - 77. http://www.mixpo.com/ - 78. http://www.photoacute.com/ - 79. http://www.wildcape.com/ - 80. http://photojockey.com/ - 81. http://smatters.com/dcraw/ - 82. http://www.k-i-s.net/ - 83. http://www.datarescue.com/photorescue/ - 84. http://www.sticksoftware.com/software/PhotoReviewer.html - 85. http://www.photovault.org/ - 86. http://www.picasa.com/ - 87. http://www.picturearena.com/ - 88. http://pleiades-astrophoto.com/ - 89. http://www.pixpo.com/ - 90. http://www.polybytes.com/ - 91. http://lens.liteserv.com/download/powershovel2.php - 92. http://www.iridientdigital.com/ - 93. http://www.rawmagick.com/ - 94. http://www.i-graph.com/ - 95. http://www.wizards.de/rawdrop - 96. http://www.pixmantec.com/ - 97. http://www.rawtherapee.com/ - 98. http://www.through-the-lens.net/ - 99. http://www.serif.com/ - 100. http://www.logicaldesigns.com/ - 101. http://www.silverfast.com/ - 102. http://www.studioline.net/ - 103. http://www.hexcat.com/viewit/ - 104. http://www.dimin.net/software/viewer/ - 105. http://www.hamrick.com/ - 106. http://www.xara.com/products/xtreme/ - 107. http://www.insflug.org/raw/ - 108. http://www.lebsanft.org/?tag=dcraw - 109. http://aminet.net/search?query=dcraw - 110. http://amis.flatrate.ru/dcraw/ - 111. http://www.pidcock.co.uk/beos/index.html - 112. http://hobbes.nmsu.edu/h-search.php?key=dcraw - 113. http://www.riscos.info/unix/indexes/graphics.html - 114. http://www.delorie.com/djgpp/ - 115. http://www.trnicely.net/misc/vista.html - 116. http://www.sno.phy.queensu.ca/~phil/exiftool/ - 117. http://www.cybercom.net/~dcoffin/dcraw/scan.c - 118. http://www.cybercom.net/~dcoffin/dcraw/read_ndf.c - 119. http://partners.adobe.com/asn/developer/PDFS/TN/TIFF6.pdf - 120. http://www.map.tu.chiba-u.ac.jp/IEC/100/TA2/recdoc/N4378.pdf - 121. http://www.adobe.com/products/dng/pdfs/dng_spec.pdf - 122. http://xyrion.org/ciff/ - 123. http://www.x3f.info/technotes/FileDocs/X3F_Format.pdf - 124. http://raw.fotosite.pl/ - 125. http://www.rawsamples.ch/ - 126. http://www.glasslantern.com/RAWpository/ - 127. http://www.imaging-resource.com/MFR1.HTM - 128. http://dl.maptools.org/dl/libtiff/tiff-3.8.2.tar.gz - 129. http://www.cybercom.net/~dcoffin/dcraw/libtiff.patch - 130. http://www.cybercom.net/~dcoffin/dcraw/elphel_dng.c - 131. http://www.adobe.com/products/dng/main.html - 132. http://www.adobe.com/products/photoshop/main.html - 133. http://cinepaint.sourceforge.net/ - 134. http://www.cybercom.net/~dcoffin/dcraw/ahd_maze.png - 135. http://www.cybercom.net/~dcoffin/dcraw/vng_grid.png - 136. http://netpbm.sourceforge.net/ - 137. http://www.imagemagick.org/ - 138. http://www.faqs.org/docs/artu/multiprogramchapter.html - 139. http://www.dpreview.com/news/0202/02021101foveonx3.asp - 140. http://digicanon.narod.ru/ - 141. http://e2500.narod.ru/raw_format_e.htm - 142. http://www.inweb.ch/foto/rawformat.html - 143. http://forums.dpreview.com/forums/read.asp?forum=1015&message=4961779 - 144. http://myfototest.narod.ru/ - 145. http://forums.dpreview.com/forums/read.asp?forum=1024&message=11773287 - 146. http://tester13.nm.ru/nikon/ - 147. http://camerahacks.10.forumer.com/ - 148. http://forums.dpreview.com/forums/read.asp?forum=1001&message=28484239 - 149. http://yousendit.com/ - 150. http://rapidshare.com/ - 151. http://sendshack.com/ - 152. http://www.sharefile.com/ - 153. http://www.sendspace.com/ - 154. http://www.file-upload.eu/ - 155. http://www.megaupload.com/ - 156. http://www.targets.coloraid.de/ - 157. http://www.calibr8.com/Current%20Products/50-Current%20Technology%20/59-ColorCharts?Products= - 158. http://www.cmp-color.fr/eng%20digital%20target.html - 159. http://www.xrite.com/product_overview.aspx?ID=820 - 160. http://www.planet-interkom.de/oliver.hartmann/dc20secr.htm - 161. http://www.itojun.org/diary/19961113/index.eng.html - 162. http://kdc2tiff.sourceforge.net/ + 46. http://www.cybercom.net/~dcoffin/dcraw/dcraw_da.1.html + 47. http://www.cybercom.net/~dcoffin/dcraw/dcraw_zh_TW.1.html + 48. http://www.cybercom.net/~dcoffin/dcraw/dcraw_zh_CN.1.html + 49. http://www.cybercom.net/~dcoffin/dcraw/msdos/ + 50. http://www.cybercom.net/~dcoffin/dcraw/dcraw.1 + 51. http://www.cybercom.net/~dcoffin/dcraw/dcraw_eo.po + 52. http://www.acdsystems.com/ + 53. http://www.adobe.com/products/photoshop/cameraraw.html + 54. http://www.br-software.com/ + 55. http://www.breezesys.com/ + 56. http://www.conceiva.com/ + 57. http://cpicture.net/en/t_raw.html + 58. http://www.canto.com/ + 59. http://frostyplace.com/dcraw/ + 60. http://www.tanis.dk/wiki/index.php/DCRawUI + 61. http://www.pretentiousname.com/jp2raw/ + 62. http://deepskystacker.free.fr/ + 63. http://www.dpmagic.com/ + 64. http://www.nla.gov.au/preserve/dohm/driftt.html + 65. http://www.easyraw.com/ + 66. http://www.lemkesoft.com/ + 67. http://jcoconsulting.com/index.asp?Section=GVOCX + 68. http://www.hdrshop.com/ + 69. http://www.aragonsystem.com/ + 70. http://www.planetimagina.com/ + 71. http://www.irfanview.com/ + 72. http://www.astrosurf.com/buil/us/iris/iris.htm + 73. http://www.kaorg.com/photoservice.asp + 74. http://www.lightboxsoftware.com/ + 75. http://sonic.net/~rat/lightcrafts/ + 76. http://imageingester.com/ + 77. http://www.mediarecover.com/ + 78. http://www.mixpo.com/ + 79. http://www.photoacute.com/ + 80. http://www.wildcape.com/ + 81. http://photojockey.com/ + 82. http://smatters.com/dcraw/ + 83. http://www.k-i-s.net/ + 84. http://www.datarescue.com/photorescue/ + 85. http://www.sticksoftware.com/software/PhotoReviewer.html + 86. http://www.photovault.org/ + 87. http://www.picasa.com/ + 88. http://www.picturearena.com/ + 89. http://pleiades-astrophoto.com/ + 90. http://www.pixpo.com/ + 91. http://www.polybytes.com/ + 92. http://lens.liteserv.com/download/powershovel2.php + 93. http://www.iridientdigital.com/ + 94. http://www.rawmagick.com/ + 95. http://www.i-graph.com/ + 96. http://www.wizards.de/rawdrop + 97. http://www.pixmantec.com/ + 98. http://www.rawtherapee.com/ + 99. http://www.through-the-lens.net/ + 100. http://www.serif.com/ + 101. http://www.logicaldesigns.com/ + 102. http://www.silverfast.com/ + 103. http://www.studioline.net/ + 104. http://www.hexcat.com/viewit/ + 105. http://www.dimin.net/software/viewer/ + 106. http://www.hamrick.com/ + 107. http://www.xara.com/products/xtreme/ + 108. http://www.insflug.org/raw/ + 109. http://www.rawness.es/dcraw/?lang=en + 110. http://aminet.net/search?query=dcraw + 111. http://amis.flatrate.ru/dcraw/ + 112. http://www.pidcock.co.uk/beos/index.html + 113. http://hobbes.nmsu.edu/h-search.php?key=dcraw + 114. http://www.riscos.info/unix/indexes/graphics.html + 115. http://www.delorie.com/djgpp/ + 116. http://www.trnicely.net/misc/vista.html + 117. http://www.sno.phy.queensu.ca/~phil/exiftool/ + 118. http://www.cybercom.net/~dcoffin/dcraw/scan.c + 119. http://www.cybercom.net/~dcoffin/dcraw/read_ndf.c + 120. http://partners.adobe.com/asn/developer/PDFS/TN/TIFF6.pdf + 121. http://www.map.tu.chiba-u.ac.jp/IEC/100/TA2/recdoc/N4378.pdf + 122. http://www.adobe.com/products/dng/pdfs/dng_spec.pdf + 123. http://xyrion.org/ciff/ + 124. http://www.x3f.info/technotes/FileDocs/X3F_Format.pdf + 125. http://raw.fotosite.pl/ + 126. http://www.rawsamples.ch/ + 127. http://www.glasslantern.com/RAWpository/ + 128. http://www.imaging-resource.com/MFR1.HTM + 129. http://dl.maptools.org/dl/libtiff/tiff-3.8.2.tar.gz + 130. http://www.cybercom.net/~dcoffin/dcraw/libtiff.patch + 131. http://www.cybercom.net/~dcoffin/dcraw/elphel_dng.c + 132. http://www.adobe.com/products/dng/main.html + 133. http://www.adobe.com/products/photoshop/main.html + 134. http://cinepaint.sourceforge.net/ + 135. http://www.cybercom.net/~dcoffin/dcraw/ahd_maze.png + 136. http://www.cybercom.net/~dcoffin/dcraw/vng_grid.png + 137. http://netpbm.sourceforge.net/ + 138. http://www.imagemagick.org/ + 139. http://www.faqs.org/docs/artu/multiprogramchapter.html + 140. http://www.dpreview.com/news/0202/02021101foveonx3.asp + 141. http://digicanon.narod.ru/ + 142. http://e2500.narod.ru/raw_format_e.htm + 143. http://www.inweb.ch/foto/rawformat.html + 144. http://forums.dpreview.com/forums/read.asp?forum=1015&message=4961779 + 145. http://myfototest.narod.ru/ + 146. http://forums.dpreview.com/forums/read.asp?forum=1024&message=11773287 + 147. http://tester13.nm.ru/nikon/ + 148. http://camerahacks.10.forumer.com/ + 149. http://forums.dpreview.com/forums/read.asp?forum=1001&message=28484239 + 150. http://yousendit.com/ + 151. http://rapidshare.com/ + 152. http://sendshack.com/ + 153. http://www.sharefile.com/ + 154. http://www.sendspace.com/ + 155. http://www.file-upload.eu/ + 156. http://www.megaupload.com/ + 157. http://www.targets.coloraid.de/ + 158. http://www.calibr8.com/Current%20Products/50-Current%20Technology%20/59-ColorCharts?Products= + 159. http://www.cmp-color.fr/eng%20digital%20target.html + 160. http://www.xrite.com/product_overview.aspx?ID=820 + 161. http://www.planet-interkom.de/oliver.hartmann/dc20secr.htm + 162. http://www.itojun.org/diary/19961113/index.eng.html + 163. http://kdc2tiff.sourceforge.net/ diff --git a/dcraw-omp.patch b/dcraw-omp.patch index d7742dc..13f7b71 100644 --- a/dcraw-omp.patch +++ b/dcraw-omp.patch @@ -1,5 +1,5 @@ ---- dcraw.c.omp 2009-07-06 23:28:36.000000000 +0200 -+++ dcraw.c 2009-11-15 16:39:25.856106000 +0100 +--- dcraw.c.orig 2010-05-02 01:23:33.000000000 +0200 ++++ dcraw.c 2010-05-02 01:24:00.000000000 +0200 @@ -217,7 +217,7 @@ #define BAYER2(row,col) \ image[((row) >> shrink)*iwidth + ((col) >> shrink)][fc(row,col)] @@ -10,7 +10,7 @@ static const char filter[16][16] = { { 2,1,1,3,2,3,2,0,3,2,3,0,1,2,1,0 }, @@ -273,7 +273,7 @@ - data_error = 1; + data_error++; } -ushort CLASS sget2 (uchar *s) @@ -75,7 +75,7 @@ { if (fread (pixel, 2, count, ifp) < count) derror(); if ((order == 0x4949) == (ntohs(0x1234) == 0x1234)) -@@ -883,7 +883,7 @@ +@@ -860,7 +860,7 @@ return diff; } @@ -84,7 +84,7 @@ { int col, c, diff, pred, spred=0; ushort mark=0, *row[3]; -@@ -922,7 +922,7 @@ +@@ -899,7 +899,7 @@ return row[2]; } @@ -93,7 +93,7 @@ { int jwide, jrow, jcol, val, jidx, i, j, row=0, col=0, nblack=0; double dark[2] = { 0,0 }; -@@ -3770,6 +3770,8 @@ +@@ -3710,6 +3710,8 @@ fputc ('\n', stderr); } size = iheight*iwidth; @@ -102,7 +102,7 @@ for (i=0; i < size*4; i++) { val = image[0][i]; if (!val) continue; -@@ -3839,7 +3841,7 @@ +@@ -3779,7 +3781,7 @@ if (half_size) filters = 0; } @@ -111,7 +111,7 @@ { unsigned row, col, y, x, f, c, sum[8]; -@@ -4127,6 +4129,7 @@ +@@ -4067,6 +4069,7 @@ lab = (short (*)[TS][TS][3])(buffer + 12*TS*TS); homo = (char (*)[TS][TS]) (buffer + 24*TS*TS); @@ -119,7 +119,7 @@ for (top=2; top < height-5; top += TS-6) for (left=2; left < width-5; left += TS-6) { -@@ -7994,8 +7997,14 @@ +@@ -8120,8 +8123,14 @@ _("Converting to %s colorspace...\n"), name[output_color-1]); memset (histogram, 0, sizeof histogram); @@ -136,7 +136,7 @@ if (!raw_color) { out[0] = out[1] = out[2] = 0; FORCC { -@@ -8007,8 +8016,12 @@ +@@ -8133,8 +8142,12 @@ } else if (document_mode) img[0] = img[FC(row,col)]; diff --git a/dcraw.c b/dcraw.c index afceb42..c45b97c 100644 --- a/dcraw.c +++ b/dcraw.c @@ -19,11 +19,11 @@ *If you have not modified dcraw.c in any way, a link to my homepage qualifies as "full source code". - $Revision: 1.425 $ - $Date: 2009/06/19 21:38:38 $ + $Revision: 1.432 $ + $Date: 2009/12/25 18:51:16 $ */ -#define VERSION "8.95" +#define VERSION "8.99" #ifndef _GNU_SOURCE #define _GNU_SOURCE @@ -270,7 +270,7 @@ void CLASS derror() else fprintf (stderr,_("Corrupt data near 0x%llx\n"), (INT64) ftello(ifp)); } - data_error = 1; + data_error++; } ushort CLASS sget2 (uchar *s) @@ -546,29 +546,6 @@ int CLASS canon_s2is() return 0; } -void CLASS canon_a5_load_raw() -{ - ushort data[2565], *dp, pixel; - int vbits=0, buf=0, row, col, bc=0; - - order = 0x4949; - for (row=-top_margin; row < raw_height-top_margin; row++) { - read_shorts (dp=data, raw_width * 10 / 16); - for (col=-left_margin; col < raw_width-left_margin; col++) { - if ((vbits -= 10) < 0) - buf = (vbits += 16, (buf << 16) + *dp++); - pixel = buf >> vbits & 0x3ff; - if ((unsigned) row < height && (unsigned) col < width) - BAYER(row,col) = pixel; - else if (col > 1-left_margin && col != width) - black += (bc++,pixel); - } - } - if (bc) black /= bc; - maximum = 0x3ff; - if (raw_width > 1600) remove_zeroes(); -} - /* getbits(-1) initializes the buffer getbits(n) where 0 <= n <= 25 returns an n-bit integer @@ -1017,7 +994,7 @@ void CLASS canon_sraw_load_raw() else ip[col][c] = (ip[col-1][c] + ip[col+1][c] + 1) >> 1; } for ( ; rp < ip[0]; rp+=4) { - if (unique_id < 0x80000200) { + if (unique_id < 0x80000218) { pix[0] = rp[0] + rp[2] - 512; pix[2] = rp[0] + rp[1] - 512; pix[1] = rp[0] + ((-778*rp[1] - (rp[2] << 11)) >> 12) - 512; @@ -1108,7 +1085,7 @@ void CLASS adobe_dng_load_raw_nc() free (pixel); } -void CLASS pentax_k10_load_raw() +void CLASS pentax_load_raw() { ushort bit[2][13], huff[4097]; int row, col, diff, c, i; @@ -1123,13 +1100,13 @@ void CLASS pentax_k10_load_raw() huff[0] = 12; fseek (ifp, data_offset, SEEK_SET); getbits(-1); - for (row=0; row < height; row++) + for (row=0; row < raw_height; row++) for (col=0; col < raw_width; col++) { diff = ljpeg_diff (huff); if (col < 2) hpred[col] = vpred[row & 1][col] += diff; else hpred[col & 1] += diff; - if (col < width) - BAYER(row,col) = hpred[col & 1]; + if ((unsigned) (row-top_margin) < height && col < width) + BAYER(row-top_margin,col) = hpred[col & 1]; if (hpred[col & 1] >> 12) derror(); } } @@ -1291,23 +1268,6 @@ int CLASS minolta_z2() return nz > 20; } -/* Here raw_width is in bytes, not pixels. */ -void CLASS nikon_e900_load_raw() -{ - int offset=0, irow, row, col; - - for (irow=0; irow < height; irow++) { - row = irow * 2 % height; - if (row == 1) - offset = - (-offset & -4096); - fseek (ifp, offset, SEEK_SET); - offset += raw_width; - getbits(-1); - for (col=0; col < width; col++) - BAYER(row,col) = getbits(10); - } -} - /* The Fuji Super CCD is just a Bayer grid rotated 45 degrees. */ @@ -1787,38 +1747,38 @@ void CLASS imacon_full_load_raw() read_shorts (image[row*width+col], 3); } -void CLASS packed_12_load_raw() +void CLASS packed_load_raw() { - int vbits=0, rbits=0, bwide, bite, irow, row, col, val, i; + int vbits=0, bwide, pwide, rbits, bite, half, irow, row, col, val, i; UINT64 bitbuf=0; - if (raw_width * 2 >= width * 3) { /* If raw_width is in bytes, */ - rbits = (bwide = raw_width) * 8; - raw_width = raw_width * 2 / 3; /* convert it to pixels and */ - rbits -= raw_width * 12; /* save the remainder. */ - } else bwide = raw_width * 3 / 2; + if (raw_width * 8 >= width * tiff_bps) /* Is raw_width in bytes? */ + pwide = (bwide = raw_width) * 8 / tiff_bps; + else bwide = (pwide = raw_width) * tiff_bps / 8; + rbits = bwide * 8 - pwide * tiff_bps; if (load_flags & 1) bwide = bwide * 16 / 15; fseek (ifp, top_margin*bwide, SEEK_CUR); bite = 8 + (load_flags & 24); + half = (height+1) >> 1; for (irow=0; irow < height; irow++) { row = irow; if (load_flags & 2 && - (row = irow * 2 % height + irow / (height/2)) == 1 && + (row = irow % half * 2 + irow / half) == 1 && load_flags & 4) { if (vbits=0, tiff_compress) - fseek (ifp, data_offset - (-width*height*3/4 & -2048), SEEK_SET); + fseek (ifp, data_offset - (-half*bwide & -2048), SEEK_SET); else { fseek (ifp, 0, SEEK_END); - fseek (ifp, ftell(ifp)/2, SEEK_SET); + fseek (ifp, ftell(ifp) >> 3 << 2, SEEK_SET); } } - for (col=0; col < raw_width; col++) { - for (vbits -= 12; vbits < 0; vbits += bite) { + for (col=0; col < pwide; col++) { + for (vbits -= tiff_bps; vbits < 0; vbits += bite) { bitbuf <<= bite; for (i=0; i < bite; i+=8) bitbuf |= (unsigned) (fgetc(ifp) << i); } - val = bitbuf << (52-vbits) >> 52; + val = bitbuf << (64-tiff_bps-vbits) >> (64-tiff_bps); i = (col ^ (bite == 24)) - left_margin; if ((unsigned) i < width) BAYER(row,i) = val << (load_flags >> 6); @@ -1829,8 +1789,8 @@ void CLASS packed_12_load_raw() } vbits -= rbits; } - if (load_flags & 32 && raw_width > width) - black /= (raw_width - width) * height; + if (load_flags & 32 && pwide > width) + black /= (pwide - width) * height; } void CLASS unpacked_load_raw() @@ -1914,7 +1874,7 @@ void CLASS panasonic_load_raw() } } -void CLASS olympus_e410_load_raw() +void CLASS olympus_load_raw() { ushort huff[4096]; int row, col, nbits, sign, low, high, i, c, w, n, nw; @@ -1986,26 +1946,6 @@ void CLASS minolta_rd175_load_raw() maximum = 0xff << 1; } -void CLASS casio_qv5700_load_raw() -{ - uchar data[3232], *dp; - ushort pixel[2576], *pix; - int row, col; - - for (row=0; row < height; row++) { - fread (data, 1, 3232, ifp); - for (dp=data, pix=pixel; dp < data+3220; dp+=5, pix+=4) { - pix[0] = (dp[0] << 2) + (dp[1] >> 6); - pix[1] = (dp[1] << 4) + (dp[2] >> 4); - pix[2] = (dp[2] << 6) + (dp[3] >> 2); - pix[3] = (dp[3] << 8) + (dp[4] ); - } - for (col=0; col < width; col++) - BAYER(row,col) = (pixel[col] & 0x3ff); - } - maximum = 0x3fc; -} - void CLASS quicktake_100_load_raw() { uchar pixel[484][644]; @@ -4495,6 +4435,14 @@ void CLASS parse_makernote (int base, int uptag) wbi = (get2(),get2()); shot_order = (get2(),get2()); } + if ((tag == 4 || tag == 0x114) && !strncmp(make,"KONICA",6)) { + fseek (ifp, tag == 4 ? 140:160, SEEK_CUR); + switch (get2()) { + case 72: flip = 0; break; + case 76: flip = 6; break; + case 82: flip = 5; break; + } + } if (tag == 7 && type == 2 && len > 20) fgets (model2, 64, ifp); if (tag == 8 && type == 4) @@ -4590,7 +4538,7 @@ void CLASS parse_makernote (int base, int uptag) goto get2_rggb; if (tag == 0x220 && len == 53) meta_offset = ftell(ifp) + 14; - if (tag == 0x401 && len == 4) { + if (tag == 0x401 && type == 4 && len == 4) { black = (get4()+get4()+get4()+get4())/4; } if (tag == 0xe01) { /* Nikon Capture Note */ @@ -4638,7 +4586,7 @@ get2_256: if ((tag | 0x70) == 0x2070 && type == 4) fseek (ifp, get4()+base, SEEK_SET); if (tag == 0x2010 && type != 7) - load_raw = &CLASS olympus_e410_load_raw; + load_raw = &CLASS olympus_load_raw; if (tag == 0x2020) parse_thumb_note (base, 257, 258); if (tag == 0x2040) @@ -4832,7 +4780,8 @@ void CLASS parse_kodak_ifd (int base) { unsigned entries, tag, type, len, save; int i, c, wbi=-2, wbtemp=6500; - float mul[3], num; + float mul[3]={1,1,1}, num; + static const int wbtag[]={ 0xfa25,0xfa28,0xfa27,0xfa29,-1,-1,0xfa2a }; entries = get2(); if (entries > 1024) return; @@ -4855,6 +4804,9 @@ void CLASS parse_kodak_ifd (int base) } if (tag == 2317) linear_table (len); if (tag == 6020) iso_speed = getint(type); + if (tag == 0xfa0d) wbi = fgetc(ifp); + if ((unsigned) wbi < 7 && tag == wbtag[wbi]) + FORC3 cam_mul[c] = get4(); fseek (ifp, save, SEEK_SET); } } @@ -5038,6 +4990,7 @@ int CLASS parse_tiff_ifd (int base) if (cfa == 072) memcpy (cfa_pc,"\005\003\004\001",4); /* GMCY */ goto guess_cfa_pc; case 33424: + case 65024: fseek (ifp, get4()+base, SEEK_SET); parse_kodak_ifd (base); break; @@ -5202,6 +5155,7 @@ guess_cfa_pc: case 50724: /* CameraCalibration2 */ for (i=0; i < colors; i++) FORCC cc[i][c] = getreal(type); + break; case 50727: /* AnalogBalance */ FORCC ab[c] = getreal(type); break; @@ -5235,7 +5189,7 @@ guess_cfa_pc: data_offset = get4(); fseek (ifp, 28, SEEK_CUR); data_offset += get4(); - load_raw = &CLASS packed_12_load_raw; + load_raw = &CLASS packed_load_raw; break; case 65026: if (type == 2) fgets (model2, 64, ifp); @@ -5321,7 +5275,7 @@ void CLASS parse_tiff (int base) case 0: case 1: switch (tiff_bps) { case 8: load_raw = &CLASS eight_bit_load_raw; break; - case 12: load_raw = &CLASS packed_12_load_raw; + case 12: load_raw = &CLASS packed_load_raw; if (tiff_ifd[raw].phint == 2) load_flags = 6; if (strncmp(make,"PENTAX",6)) break; @@ -5329,7 +5283,9 @@ void CLASS parse_tiff (int base) case 16: load_raw = &CLASS unpacked_load_raw; break; } if (tiff_ifd[raw].bytes*5 == raw_width*raw_height*8) { - load_raw = &CLASS packed_12_load_raw; + tiff_bps = 12; + maximum = 0xffff; + load_raw = &CLASS packed_load_raw; load_flags = 273; } break; @@ -5338,23 +5294,23 @@ void CLASS parse_tiff (int base) case 262: load_raw = &CLASS kodak_262_load_raw; break; case 32767: + if (tiff_ifd[raw].bytes == raw_width*raw_height) { + tiff_bps = 12; + load_raw = &CLASS sony_arw2_load_raw; break; + } if (tiff_ifd[raw].bytes*8 != raw_width*raw_height*tiff_bps) { raw_height += 8; load_raw = &CLASS sony_arw_load_raw; break; } - if (tiff_bps == 8) { - tiff_bps = 12; - load_raw = &CLASS sony_arw2_load_raw; break; - } load_flags = 79; case 32769: load_flags++; case 32773: - load_raw = &CLASS packed_12_load_raw; break; + load_raw = &CLASS packed_load_raw; break; case 34713: load_raw = &CLASS nikon_compressed_load_raw; break; case 65535: - load_raw = &CLASS pentax_k10_load_raw; break; + load_raw = &CLASS pentax_load_raw; break; case 65000: switch (tiff_ifd[raw].phint) { case 2: load_raw = &CLASS kodak_rgb_load_raw; filters = 0; break; @@ -5773,8 +5729,11 @@ void CLASS parse_fuji (int offset) } else if (tag == 0x121) { height = get2(); if ((width = get2()) == 4284) width += 3; - } else if (tag == 0x130) + } else if (tag == 0x130) { fuji_layout = fgetc(ifp) >> 7; + load_raw = fgetc(ifp) & 8 ? + &CLASS unpacked_load_raw : &CLASS fuji_load_raw; + } if (tag == 0x2ff0) FORC4 cam_mul[c ^ 1] = get2(); fseek (ifp, save+len, SEEK_SET); @@ -6014,7 +5973,7 @@ void CLASS parse_foveon() } /* - Thanks to Adobe for providing these excellent CAM -> XYZ matrices! + All matrices are from Adobe DNG Converter unless otherwise noted. */ void CLASS adobe_coeff (const char *make, const char *model) { @@ -6038,6 +5997,8 @@ void CLASS adobe_coeff (const char *make, const char *model) { 4716,603,-830,-7798,15474,2480,-1496,1937,6651 } }, { "Canon EOS 5D", 0, 0xe6c, { 6347,-479,-972,-8297,15954,2480,-1968,2131,7649 } }, + { "Canon EOS 7D", 0, 0x3510, + { 6844,-996,-856,-3876,11761,2396,-593,1772,6198 } }, { "Canon EOS 10D", 0, 0xfa0, { 8197,-2000,-1118,-6714,14335,2592,-2536,3178,8266 } }, { "Canon EOS 20Da", 0, 0, @@ -6058,16 +6019,20 @@ void CLASS adobe_coeff (const char *make, const char *model) { 7054,-1501,-990,-8156,15544,2812,-1278,1414,7796 } }, { "Canon EOS 450D", 0, 0x390d, { 5784,-262,-821,-7539,15064,2672,-1982,2681,7427 } }, + { "Canon EOS 500D", 0, 0x3479, + { 4763,712,-646,-6821,14399,2640,-1921,3276,6561 } }, { "Canon EOS 1000D", 0, 0xe43, { 6771,-1139,-977,-7818,15123,2928,-1244,1437,7533 } }, { "Canon EOS-1Ds Mark III", 0, 0x3bb0, { 5859,-211,-930,-8255,16017,2353,-1732,1887,7448 } }, { "Canon EOS-1Ds Mark II", 0, 0xe80, { 6517,-602,-867,-8180,15926,2378,-1618,1771,7633 } }, - { "Canon EOS-1D Mark II N", 0, 0xe80, - { 6240,-466,-822,-8180,15825,2500,-1801,1938,8042 } }, + { "Canon EOS-1D Mark IV", 0, 0x3bb0, + { 6014,-220,-795,-4109,12014,2361,-561,1824,5787 } }, { "Canon EOS-1D Mark III", 0, 0x3bb0, { 6291,-540,-976,-8350,16145,2311,-1714,1858,7326 } }, + { "Canon EOS-1D Mark II N", 0, 0xe80, + { 6240,-466,-822,-8180,15825,2500,-1801,1938,8042 } }, { "Canon EOS-1D Mark II", 0, 0xe80, { 6264,-582,-724,-8312,15948,2504,-1744,1919,8664 } }, { "Canon EOS-1DS", 0, 0xe20, @@ -6076,12 +6041,16 @@ void CLASS adobe_coeff (const char *make, const char *model) { 6806,-179,-1020,-8097,16415,1687,-3267,4236,7690 } }, { "Canon EOS", 0, 0, { 8197,-2000,-1118,-6714,14335,2592,-2536,3178,8266 } }, + { "Canon PowerShot A530", 0, 0, + { 0 } }, /* don't want the A5 matrix */ { "Canon PowerShot A50", 0, 0, { -5300,9846,1776,3436,684,3939,-5540,9879,6200,-1404,11175,217 } }, { "Canon PowerShot A5", 0, 0, { -4801,9475,1952,2926,1611,4094,-5259,10164,5947,-1554,10883,547 } }, { "Canon PowerShot G10", 0, 0, { 11093,-3906,-1028,-5047,12492,2879,-1003,1750,5561 } }, + { "Canon PowerShot G11", 0, 0, + { 12177,-4817,-1069,-1612,9864,2049,-98,850,4471 } }, { "Canon PowerShot G1", 0, 0, { -4778,9467,2172,4743,-1141,4344,-5146,9908,6077,-1566,11051,557 } }, { "Canon PowerShot G2", 0, 0, @@ -6112,6 +6081,10 @@ void CLASS adobe_coeff (const char *make, const char *model) { 8795,-2482,-797,-7804,15403,2573,-1422,1996,7082 } }, { "Canon PowerShot S70", 0, 0, { 9976,-3810,-832,-7115,14463,2906,-901,989,7889 } }, + { "Canon PowerShot S90", 0, 0, + { 12374,-5016,-1049,-1677,9902,2078,-83,852,4683 } }, + { "Canon PowerShot A470", 0, 0, /* DJC */ + { 12513,-4407,-1242,-2680,10276,2405,-878,2215,4734 } }, { "Canon PowerShot A610", 0, 0, /* DJC */ { 15591,-6402,-1592,-5365,13198,2168,-1300,1824,5075 } }, { "Canon PowerShot A620", 0, 0, /* DJC */ @@ -6126,12 +6099,14 @@ void CLASS adobe_coeff (const char *make, const char *model) { 14573,-5482,-1546,-1266,9799,1468,-1040,1912,3810 } }, { "Canon PowerShot S3 IS", 0, 0, /* DJC */ { 14062,-5199,-1446,-4712,12470,2243,-1286,2028,4836 } }, - { "Canon PowerShot SX1 IS", 0, 0, /* DJC */ - { 10013,-2214,-1111,-3650,11589,2062,342,685,3617 } }, + { "Canon PowerShot SX1 IS", 0, 0, + { 6578,-259,-502,-5974,13030,3309,-308,1058,4970 } }, { "Canon PowerShot SX110 IS", 0, 0, /* DJC */ { 14134,-5576,-1527,-1991,10719,1273,-1158,1929,3581 } }, { "CASIO EX-S20", 0, 0, /* DJC */ { 11634,-3924,-1128,-4968,12954,2015,-1588,2648,7206 } }, + { "CASIO EX-Z750", 0, 0, /* DJC */ + { 10819,-3873,-1099,-4903,13730,1175,-1755,3751,4632 } }, { "CINE 650", 0, 0, { 3390,480,-500,-800,3610,340,-550,2336,1192 } }, { "CINE 660", 0, 0, @@ -6232,6 +6207,10 @@ void CLASS adobe_coeff (const char *make, const char *model) { 10511,-3836,-1102,-6946,14587,2558,-1481,1792,6246 } }, { "KODAK P880", 0, 0xfff, { 12805,-4662,-1376,-7480,15267,2360,-1626,2194,7904 } }, + { "KODAK EasyShare Z980", 0, 0, + { 11313,-3559,-1101,-3893,11891,2257,-1214,2398,4908 } }, + { "KODAK EASYSHARE Z1015", 0, 0xef1, + { 11265,-4286,-992,-4694,12343,2647,-1090,1523,5447 } }, { "Leaf CMost", 0, 0, { 3952,2189,449,-6701,14585,2275,-4536,7349,6536 } }, { "Leaf Valeo 6", 0, 0, @@ -6276,14 +6255,28 @@ void CLASS adobe_coeff (const char *make, const char *model) { 7702,-2245,-975,-9114,17242,1875,-2679,3055,8521 } }, { "NIKON D1", 0, 0, /* multiplied by 2.218750, 1.0, 1.148438 */ { 16772,-4726,-2141,-7611,15713,1972,-2846,3494,9521 } }, + { "NIKON D200", 0, 0xfbc, + { 8367,-2248,-763,-8758,16447,2422,-1527,1550,8053 } }, { "NIKON D2H", 0, 0, { 5710,-901,-615,-8594,16617,2024,-2975,4120,6830 } }, { "NIKON D2X", 0, 0, { 10231,-2769,-1255,-8301,15900,2552,-797,680,7148 } }, + { "NIKON D3000", 0, 0, + { 8736,-2458,-935,-9075,16894,2251,-1354,1242,8263 } }, + { "NIKON D300", 0, 0, + { 9030,-1992,-715,-8465,16302,2255,-2689,3217,8069 } }, + { "NIKON D3X", 0, 0, + { 7171,-1986,-648,-8085,15555,2718,-2170,2512,7457 } }, + { "NIKON D3S", 0, 0, + { 8828,-2406,-694,-4874,12603,2541,-660,1509,7587 } }, + { "NIKON D3", 0, 0, + { 8139,-2171,-663,-8747,16541,2295,-1925,2008,8093 } }, { "NIKON D40X", 0, 0, { 8819,-2543,-911,-9025,16928,2151,-1329,1213,8449 } }, { "NIKON D40", 0, 0, { 6992,-1668,-806,-8138,15748,2543,-874,850,7897 } }, + { "NIKON D5000", 0, 0xf00, + { 7309,-1403,-519,-8474,16008,2622,-2433,2826,8064 } }, { "NIKON D50", 0, 0, { 7732,-2422,-789,-8238,15884,2498,-859,783,7330 } }, { "NIKON D60", 0, 0, @@ -6296,14 +6289,6 @@ void CLASS adobe_coeff (const char *make, const char *model) { 8629,-2410,-883,-9055,16940,2171,-1490,1363,8520 } }, { "NIKON D90", 0, 0xf00, { 7309,-1403,-519,-8474,16008,2622,-2434,2826,8064 } }, - { "NIKON D200", 0, 0xfbc, - { 8367,-2248,-763,-8758,16447,2422,-1527,1550,8053 } }, - { "NIKON D300", 0, 0, - { 9030,-1992,-715,-8465,16302,2255,-2689,3217,8069 } }, - { "NIKON D3X", 0, 0, - { 7171,-1986,-648,-8085,15555,2718,-2170,2512,7457 } }, - { "NIKON D3", 0, 0, - { 8139,-2171,-663,-8747,16541,2295,-1925,2008,8093 } }, { "NIKON E950", 0, 0x3dd, /* DJC */ { -3746,10611,1665,9621,-1734,2114,-2389,7082,3064,3406,6116,-244 } }, { "NIKON E995", 0, 0, /* copied from E5000 */ @@ -6350,7 +6335,7 @@ void CLASS adobe_coeff (const char *make, const char *model) { 7828,-1761,-348,-5788,14071,1830,-2853,4518,6557 } }, { "OLYMPUS E-330", 0, 0, { 8961,-2473,-1084,-7979,15990,2067,-2319,3035,8249 } }, - { "OLYMPUS E-30", 0, 0, + { "OLYMPUS E-30", 0, 0xfbc, { 8144,-1861,-1111,-7763,15894,1929,-1865,2542,7607 } }, { "OLYMPUS E-3", 0, 0xf99, { 9487,-2875,-1115,-7533,15606,2010,-1618,2100,7389 } }, @@ -6360,12 +6345,18 @@ void CLASS adobe_coeff (const char *make, const char *model) { 8856,-2582,-1026,-7761,15766,2082,-2009,2575,7469 } }, { "OLYMPUS E-420", 0, 0xfd7, { 8746,-2425,-1095,-7594,15612,2073,-1780,2309,7416 } }, - { "OLYMPUS E-500", 0, 0, + { "OLYMPUS E-450", 0, 0xfd2, + { 8745,-2425,-1095,-7594,15613,2073,-1780,2309,7416 } }, + { "OLYMPUS E-500", 0, 0xfff0, { 8136,-1968,-299,-5481,13742,1871,-2556,4205,6630 } }, { "OLYMPUS E-510", 0, 0xf6a, { 8785,-2529,-1033,-7639,15624,2112,-1783,2300,7817 } }, { "OLYMPUS E-520", 0, 0xfd2, { 8344,-2322,-1020,-7596,15635,2048,-1748,2269,7287 } }, + { "OLYMPUS E-620", 0, 0xfb9, + { 8453,-2198,-1092,-7609,15681,2008,-1725,2337,7824 } }, + { "OLYMPUS E-P1", 0, 0xffd, + { 8343,-2050,-1021,-7715,15705,2103,-1831,2380,8235 } }, { "OLYMPUS SP350", 0, 0, { 12078,-4836,-1069,-6671,14306,2578,-786,939,7418 } }, { "OLYMPUS SP3", 0, 0, @@ -6402,6 +6393,10 @@ void CLASS adobe_coeff (const char *make, const char *model) { 11057,-3604,-1155,-5152,13046,2329,-282,375,8104 } }, { "PENTAX K-m", 0, 0, { 11057,-3604,-1155,-5152,13046,2329,-282,375,8104 } }, + { "PENTAX K-x", 0, 0, + { 8843,-2837,-625,-5025,12644,2668,-411,1234,7410 } }, + { "PENTAX K-7", 0, 0, + { 9142,-2947,-678,-8648,16967,1663,-2224,2898,8615 } }, { "Panasonic DMC-FZ8", 0, 0xf7f0, { 8986,-2755,-802,-6341,13575,3077,-1476,2144,6379 } }, { "Panasonic DMC-FZ18", 0, 0, @@ -6410,6 +6405,8 @@ void CLASS adobe_coeff (const char *make, const char *model) { 10109,-3488,-993,-5412,12812,2916,-1305,2140,5543 } }, { "Panasonic DMC-FZ30", 0, 0xf94c, { 10976,-4029,-1141,-7918,15491,2600,-1670,2071,8246 } }, + { "Panasonic DMC-FZ35", 147, 0xfff, + { 9938,-2780,-890,-4604,12393,2480,-1117,2304,4620 } }, { "Panasonic DMC-FZ50", 0, 0xfff0, /* aka "LEICA V-LUX1" */ { 7906,-2709,-594,-6231,13351,3220,-1922,2631,6537 } }, { "Panasonic DMC-L10", 15, 0xf96, @@ -6428,8 +6425,10 @@ void CLASS adobe_coeff (const char *make, const char *model) { 9082,-2907,-925,-6119,13377,3058,-1797,2641,5609 } }, { "Panasonic DMC-G1", 15, 0xfff, { 8199,-2065,-1056,-8124,16156,2033,-2458,3022,7220 } }, - { "Panasonic DMC-GH1", 15, 0xfff, /* DJC */ - { 7808,-2387,-480,-2859,10002,2857,-1001,2012,4915 } }, + { "Panasonic DMC-GF1", 15, 0xf92, + { 7888,-1902,-1011,-8106,16085,2099,-2353,2866,7330 } }, + { "Panasonic DMC-GH1", 15, 0xf92, + { 6299,-1466,-532,-6535,13852,2969,-2331,3112,5984 } }, { "Phase One H 20", 0, 0, /* DJC */ { 1313,1855,-109,-6715,15908,808,-327,1840,6020 } }, { "Phase One P 2", 0, 0, @@ -6456,12 +6455,22 @@ void CLASS adobe_coeff (const char *make, const char *model) { 9437,-2811,-774,-8405,16215,2290,-710,596,7181 } }, { "SONY DSLR-A200", 0, 0, { 9847,-3091,-928,-8485,16345,2225,-715,595,7103 } }, + { "SONY DSLR-A230", 0, 0, /* copied */ + { 9847,-3091,-928,-8485,16345,2225,-715,595,7103 } }, { "SONY DSLR-A300", 0, 0, { 9847,-3091,-928,-8485,16345,2225,-715,595,7103 } }, + { "SONY DSLR-A330", 0, 0, + { 9847,-3091,-929,-8485,16346,2225,-714,595,7103 } }, { "SONY DSLR-A350", 0, 0xffc, { 6038,-1484,-578,-9146,16746,2513,-875,746,7217 } }, + { "SONY DSLR-A380", 0, 0, + { 6038,-1484,-579,-9145,16746,2512,-875,746,7218 } }, + { "SONY DSLR-A5", 254, 0x1ffe, + { 4950,-580,-103,-5228,12542,3029,-709,1435,7371 } }, { "SONY DSLR-A700", 254, 0x1ffe, { 5775,-805,-359,-8574,16295,2391,-1943,2341,7249 } }, + { "SONY DSLR-A850", 256, 0x1ffe, + { 5413,-1162,-365,-5665,13098,2866,-608,1179,8440 } }, { "SONY DSLR-A900", 254, 0x1ffe, { 5209,-1072,-397,-8845,16120,2919,-1618,1803,8654 } } }; @@ -6474,9 +6483,11 @@ void CLASS adobe_coeff (const char *make, const char *model) if (!strncmp (name, table[i].prefix, strlen(table[i].prefix))) { if (table[i].black) black = (ushort) table[i].black; if (table[i].maximum) maximum = (ushort) table[i].maximum; - for (j=0; j < 12; j++) - cam_xyz[0][j] = table[i].trans[j] / 10000.0; - cam_xyz_coeff (cam_xyz); + if (table[i].trans[0]) { + for (j=0; j < 12; j++) + cam_xyz[0][j] = table[i].trans[j] / 10000.0; + cam_xyz_coeff (cam_xyz); + } break; } } @@ -6520,6 +6531,31 @@ short CLASS guess_byte_order (int words) return sum[0] < sum[1] ? 0x4d4d : 0x4949; } +float CLASS find_green (int bps, int bite, int off0, int off1) +{ + UINT64 bitbuf=0; + int vbits, col, i, c; + ushort img[2][2064]; + double sum[]={0,0}; + + FORC(2) { + fseek (ifp, c ? off1:off0, SEEK_SET); + for (vbits=col=0; col < width; col++) { + for (vbits -= bps; vbits < 0; vbits += bite) { + bitbuf <<= bite; + for (i=0; i < bite; i+=8) + bitbuf |= (unsigned) (fgetc(ifp) << i); + } + img[c][col] = bitbuf << (64-bps-vbits) >> (64-bps); + } + } + FORC(width-1) { + sum[ c & 1] += ABS(img[0][c]-img[1][c+1]); + sum[~c & 1] += ABS(img[1][c]-img[0][c+1]); + } + return 100 * log(sum[0]/sum[1]); +} + /* Identify which camera created this file, and set global variables accordingly. @@ -6527,7 +6563,7 @@ short CLASS guess_byte_order (int words) void CLASS identify() { char head[32], *cp; - unsigned hlen, fsize, i, c, is_canon; + int hlen, fsize, i, c, is_canon; struct jhead jh; static const struct { int fsize; @@ -6544,7 +6580,6 @@ void CLASS identify() { 6166488, "Kodak", "C603" ,0 }, { 9116448, "Kodak", "C603y" ,0 }, { 311696, "ST Micro", "STV680 VGA" ,0 }, /* SPYz */ - { 614400, "Kodak", "KAI-0340" ,0 }, { 787456, "Creative", "PC-CAM 600" ,0 }, { 1138688, "Minolta", "RD175" ,0 }, { 3840000, "Foculus", "531C" ,0 }, @@ -6564,6 +6599,7 @@ void CLASS identify() { 6653280, "Canon", "PowerShot A530" ,0 }, { 6573120, "Canon", "PowerShot A610" ,0 }, { 9219600, "Canon", "PowerShot A620" ,0 }, + { 9243240, "Canon", "PowerShot A470" ,0 }, { 10341600, "Canon", "PowerShot A720" ,0 }, { 10383120, "Canon", "PowerShot A630" ,0 }, { 12945240, "Canon", "PowerShot A640" ,0 }, @@ -6591,6 +6627,10 @@ void CLASS identify() { 4948608, "CASIO", "EX-S100" ,1 }, { 7542528, "CASIO", "EX-Z50" ,1 }, { 7753344, "CASIO", "EX-Z55" ,1 }, + { 7816704, "CASIO", "EX-Z60" ,1 }, + { 10843712, "CASIO", "EX-Z75" ,1 }, + { 10834368, "CASIO", "EX-Z750" ,1 }, + { 12310144, "CASIO", "EX-Z850" ,1 }, { 7426656, "CASIO", "EX-P505" ,1 }, { 9313536, "CASIO", "EX-P600" ,1 }, { 10979200, "CASIO", "EX-P700" ,1 }, @@ -6632,7 +6672,6 @@ void CLASS identify() FORC3 rgb_cam[c][i] = c == i; } colors = 3; - tiff_bps = 12; for (i=0; i < 0x4000; i++) curve[i] = i; order = get2(); @@ -6730,7 +6769,8 @@ void CLASS identify() if (strstr (make, corp[i])) /* Simplify company names */ strcpy (make, corp[i]); if (!strncmp (make,"KODAK",5) && - ((cp = strstr(model,"DIGITAL CAMERA")) || + ((cp = strstr(model," DIGITAL CAMERA")) || + (cp = strstr(model," Digital Camera")) || (cp = strstr(model,"FILE VERSION")))) *cp = 0; cp = make + strlen(make); /* Remove trailing spaces */ @@ -6745,7 +6785,6 @@ void CLASS identify() desc[511] = artist[63] = make[63] = model[63] = model2[63] = 0; if (!is_raw) goto notraw; - if (!maximum) maximum = (1 << tiff_bps) - 1; if (!height) height = raw_height; if (!width) width = raw_width; if (fuji_width) { @@ -6757,6 +6796,9 @@ void CLASS identify() { height = 2616; width = 3896; } if (height == 3136 && width == 4864) /* Pentax K20D */ { height = 3124; width = 4688; } + if (height == 3136 && width == 4736) /* Pentax K-7 */ + { height = 3122; width = 4684; + top_margin = 2; filters = 0x16161616; } if (height == 3014 && width == 4096) /* Ricoh GX200 */ width = 4014; if (dng_version) { @@ -6774,12 +6816,12 @@ void CLASS identify() &CLASS lossless_jpeg_load_raw : &CLASS canon_compressed_load_raw; if (!strcmp(make,"NIKON")) { if (!load_raw) - load_raw = &CLASS packed_12_load_raw; + load_raw = &CLASS packed_load_raw; if (model[0] == 'E') load_flags |= !data_offset << 2 | 2; } if (!strcmp(make,"CASIO")) { - load_raw = &CLASS packed_12_load_raw; + load_raw = &CLASS packed_load_raw; maximum = 0xf7f; } @@ -6814,20 +6856,20 @@ void CLASS identify() pixel_aspect = 256/235.0; colors = 4; filters = 0x1e4e1e4e; - load_raw = &CLASS canon_a5_load_raw; + goto canon_a5; } else if (!strcmp(model,"PowerShot A50")) { height = 968; width = 1290; raw_width = 1320; colors = 4; filters = 0x1b4e4b1e; - load_raw = &CLASS canon_a5_load_raw; + goto canon_a5; } else if (!strcmp(model,"PowerShot Pro70")) { height = 1024; width = 1552; colors = 4; filters = 0x1e4b4e1b; - load_raw = &CLASS canon_a5_load_raw; + goto canon_a5; } else if (!strcmp(model,"PowerShot SD300")) { height = 1752; width = 2344; @@ -6835,7 +6877,7 @@ void CLASS identify() raw_width = 2400; top_margin = 12; left_margin = 12; - load_raw = &CLASS canon_a5_load_raw; + goto canon_a5; } else if (!strcmp(model,"PowerShot A460")) { height = 1960; width = 2616; @@ -6843,7 +6885,7 @@ void CLASS identify() raw_width = 2664; top_margin = 4; left_margin = 4; - load_raw = &CLASS canon_a5_load_raw; + goto canon_a5; } else if (!strcmp(model,"PowerShot A530")) { height = 1984; width = 2620; @@ -6851,8 +6893,7 @@ void CLASS identify() raw_width = 2672; top_margin = 6; left_margin = 10; - load_raw = &CLASS canon_a5_load_raw; - raw_color = 0; + goto canon_a5; } else if (!strcmp(model,"PowerShot A610")) { if (canon_s2is()) strcpy (model+10, "S2 IS"); height = 1960; @@ -6861,7 +6902,7 @@ void CLASS identify() raw_width = 2672; top_margin = 8; left_margin = 12; - load_raw = &CLASS canon_a5_load_raw; + goto canon_a5; } else if (!strcmp(model,"PowerShot A620")) { height = 2328; width = 3112; @@ -6869,7 +6910,15 @@ void CLASS identify() raw_width = 3152; top_margin = 12; left_margin = 36; - load_raw = &CLASS canon_a5_load_raw; + goto canon_a5; + } else if (!strcmp(model,"PowerShot A470")) { + height = 2328; + width = 3096; + raw_height = 2346; + raw_width = 3152; + top_margin = 6; + left_margin = 12; + goto canon_a5; } else if (!strcmp(model,"PowerShot A720")) { height = 2472; width = 3298; @@ -6877,7 +6926,7 @@ void CLASS identify() raw_width = 3336; top_margin = 5; left_margin = 6; - load_raw = &CLASS canon_a5_load_raw; + goto canon_a5; } else if (!strcmp(model,"PowerShot A630")) { height = 2472; width = 3288; @@ -6885,7 +6934,7 @@ void CLASS identify() raw_width = 3344; top_margin = 6; left_margin = 12; - load_raw = &CLASS canon_a5_load_raw; + goto canon_a5; } else if (!strcmp(model,"PowerShot A640")) { height = 2760; width = 3672; @@ -6893,7 +6942,7 @@ void CLASS identify() raw_width = 3736; top_margin = 6; left_margin = 12; - load_raw = &CLASS canon_a5_load_raw; + goto canon_a5; } else if (!strcmp(model,"PowerShot A650")) { height = 3024; width = 4032; @@ -6901,7 +6950,7 @@ void CLASS identify() raw_width = 4104; top_margin = 12; left_margin = 48; - load_raw = &CLASS canon_a5_load_raw; + goto canon_a5; } else if (!strcmp(model,"PowerShot S3 IS")) { height = 2128; width = 2840; @@ -6909,7 +6958,11 @@ void CLASS identify() raw_width = 2888; top_margin = 8; left_margin = 44; - load_raw = &CLASS canon_a5_load_raw; +canon_a5: + tiff_bps = 10; + load_raw = &CLASS packed_load_raw; + load_flags = 40; + if (raw_width > 1600) zero_is_bad = 1; } else if (!strcmp(model,"PowerShot SX110 IS")) { height = 2760; width = 3684; @@ -6917,7 +6970,7 @@ void CLASS identify() raw_width = 3720; top_margin = 12; left_margin = 6; - load_raw = &CLASS packed_12_load_raw; + load_raw = &CLASS packed_load_raw; load_flags = 40; zero_is_bad = 1; } else if (!strcmp(model,"PowerShot Pro90 IS")) { @@ -6978,6 +7031,11 @@ void CLASS identify() top_margin = 12; left_margin = 74; goto canon_cr2; + } else if (is_canon && raw_width == 3744) { + height = 2760; + width = 3684; + top_margin = 16; + left_margin = 8; } else if (is_canon && raw_width == 3944) { height = 2602; width = 3908; @@ -7027,6 +7085,18 @@ void CLASS identify() top_margin = unique_id == 0x80000261 ? 51:26; left_margin = 62; raw_width = width *= 4; + if (unique_id == 0x80000252) + adobe_coeff ("Canon","EOS 500D"); + goto canon_cr2; + } else if (is_canon && raw_width == 1280) { + height -= top_margin = 45; + left_margin = 142; + raw_width *= 4; + width = 4916; + } else if (is_canon && raw_width == 1340) { + top_margin = 51; + left_margin = 158; + raw_width = width *= 4; goto canon_cr2; } else if (is_canon && raw_width == 1448) { top_margin = 51; @@ -7052,13 +7122,17 @@ canon_cr2: pixel_aspect = 0.5; } else if (!strcmp(model,"D40X") || !strcmp(model,"D60") || - !strcmp(model,"D80")) { + !strcmp(model,"D80") || + !strcmp(model,"D3000")) { height -= 3; width -= 4; } else if (!strcmp(model,"D3") || + !strcmp(model,"D3S") || !strcmp(model,"D700")) { width -= 4; left_margin = 2; + } else if (!strcmp(model,"D5000")) { + width -= 42; } else if (!strncmp(model,"D40",3) || !strncmp(model,"D50",3) || !strncmp(model,"D70",3)) { @@ -7067,7 +7141,7 @@ canon_cr2: width -= 42; } else if (!strcmp(model,"D100")) { if (tiff_compress == 34713 && !nikon_is_compressed()) { - load_raw = &CLASS packed_12_load_raw; + load_raw = &CLASS packed_load_raw; load_flags |= 1; raw_width = (width += 3) + 3; } @@ -7081,7 +7155,7 @@ canon_cr2: } else if (!strncmp(model,"D2X",3)) { if (width == 3264) width -= 32; else width -= 8; - } else if (!strcmp(model,"D300")) { + } else if (!strncmp(model,"D300",4)) { width -= 32; } else if (!strcmp(model,"COOLPIX P6000")) { load_flags = 24; @@ -7090,7 +7164,6 @@ canon_cr2: height = 963; width = 1287; raw_width = 1632; - load_raw = &CLASS nikon_e900_load_raw; maximum = 0x3f4; colors = 4; filters = 0x1e1e1e1e; @@ -7098,20 +7171,24 @@ canon_cr2: pre_mul[0] = 1.2085; pre_mul[1] = 1.0943; pre_mul[3] = 1.1103; + goto e900; } else if (fsize == 2465792) { height = 1203; width = 1616; raw_width = 2048; - load_raw = &CLASS nikon_e900_load_raw; colors = 4; filters = 0x4b4b4b4b; adobe_coeff ("NIKON","E950"); +e900: + tiff_bps = 10; + load_raw = &CLASS packed_load_raw; + load_flags = 6; } else if (fsize == 4771840) { height = 1540; width = 2064; colors = 4; filters = 0xe1e1e1e1; - load_raw = &CLASS packed_12_load_raw; + load_raw = &CLASS packed_load_raw; load_flags = 6; if (!timestamp && nikon_e995()) strcpy (model, "E995"); @@ -7137,7 +7214,7 @@ cp_e2500: } else if (fsize == 4775936) { height = 1542; width = 2064; - load_raw = &CLASS packed_12_load_raw; + load_raw = &CLASS packed_load_raw; load_flags = 30; if (!timestamp) nikon_3700(); if (model[0] == 'E' && atoi(model+1) < 3700) @@ -7146,6 +7223,15 @@ cp_e2500: flip = 1; filters = 0x16161616; } + if (make[0] == 'O') { + i = find_green (12, 32, 0, fsize/2); + c = find_green (12, 32, 0, 3096); + if (abs(i) < abs(c)) { + SWAP(i,c); + load_flags = 24; + } + if (i < 0) filters = 0x61616161; + } } else if (fsize == 5869568) { height = 1710; width = 2288; @@ -7154,7 +7240,7 @@ cp_e2500: strcpy (make, "Minolta"); strcpy (model,"DiMAGE Z2"); } - load_raw = &CLASS packed_12_load_raw; + load_raw = &CLASS packed_load_raw; load_flags = 6 + 24*(make[0] == 'M'); } else if (!strcmp(model,"E4500")) { height = 1708; @@ -7170,11 +7256,8 @@ cp_e2500: height = 2118; width = 2832; maximum = 0xf83; - load_raw = &CLASS packed_12_load_raw; + load_raw = &CLASS packed_load_raw; load_flags = 30; - } else if (!strcmp(model,"FinePix S5100") || - !strcmp(model,"FinePix S5500")) { - load_raw = &CLASS unpacked_load_raw; } else if (!strcmp(make,"FUJIFILM")) { if (!strcmp(model+7,"S2Pro")) { strcpy (model+7," S2Pro"); @@ -7190,12 +7273,13 @@ cp_e2500: if (is_raw == 2) data_offset += (shot_select > 0) * ( fuji_layout ? (raw_width *= 2) : raw_height*raw_width*2 ); - fuji_width = width >> !fuji_layout; - width = (height >> fuji_layout) + fuji_width; - raw_height = height; - height = width - 1; - load_raw = &CLASS fuji_load_raw; - if (!(fuji_width & 1)) filters = 0x49494949; + if (load_raw == &CLASS fuji_load_raw) { + fuji_width = width >> !fuji_layout; + width = (height >> fuji_layout) + fuji_width; + raw_height = height; + height = width - 1; + if (~fuji_width & 1) filters = 0x49494949; + } } else if (!strcmp(model,"RD175")) { height = 986; width = 1534; @@ -7215,13 +7299,14 @@ cp_e2500: if (!strncmp(model,"DiMAGE A",8)) { if (!strcmp(model,"DiMAGE A200")) filters = 0x49494949; - load_raw = &CLASS packed_12_load_raw; + tiff_bps = 12; + load_raw = &CLASS packed_load_raw; } else if (!strncmp(model,"ALPHA",5) || !strncmp(model,"DYNAX",5) || !strncmp(model,"MAXXUM",6)) { sprintf (model+20, "DYNAX %-10s", model+6+(model[0]=='M')); adobe_coeff (make, model+20); - load_raw = &CLASS packed_12_load_raw; + load_raw = &CLASS packed_load_raw; } else if (!strncmp(model,"DiMAGE G",8)) { if (model[8] == '4') { height = 1716; @@ -7242,10 +7327,15 @@ konica_400z: maximum = 0x3df; order = 0x4d4d; } + } else if (!strcmp(model,"*ist D")) { + data_error = -1; } else if (!strcmp(model,"*ist DS")) { height -= 2; } else if (!strcmp(model,"K20D")) { filters = 0x16161616; + } else if (!strcmp(model,"K-x")) { + width = 4309; + filters = 0x16161616; } else if (!strcmp(model,"Optio S")) { if (fsize == 3178560) { height = 1540; @@ -7257,19 +7347,19 @@ konica_400z: height = 1544; width = 2068; raw_width = 3136; - load_raw = &CLASS packed_12_load_raw; + load_raw = &CLASS packed_load_raw; maximum = 0xf7c; } } else if (fsize == 6114240) { height = 1737; width = 2324; raw_width = 3520; - load_raw = &CLASS packed_12_load_raw; + load_raw = &CLASS packed_load_raw; maximum = 0xf7a; } else if (!strcmp(model,"Optio 750Z")) { height = 2302; width = 3072; - load_raw = &CLASS packed_12_load_raw; + load_raw = &CLASS packed_load_raw; load_flags = 30; } else if (!strcmp(model,"DC-833m")) { height = 2448; @@ -7292,12 +7382,6 @@ konica_400z: flip = 2; filters = 0x16161616; black = 16; - } else if (!strcmp(model,"KAI-0340")) { - height = 477; - width = 640; - order = 0x4949; - data_offset = 3840; - load_raw = &CLASS unpacked_load_raw; } else if (!strcmp(model,"N95")) { height = raw_height - (top_margin = 2); } else if (!strcmp(model,"531C")) { @@ -7504,16 +7588,21 @@ lx3: filters = 0x16161616; zero_is_bad = 1; adobe_coeff ("Panasonic","DMC-LX1"); break; case 4060: - if (!strcmp(model,"DMC-GH1")) goto gh1; width = 3982; if (height == 2250) goto lx3; width = 4018; + filters = 0x16161616; + if (!strncmp(model,"DMC-FZ3",7)) { + height -= 2; + adobe_coeff ("Panasonic","DMC-FZ35"); break; + } filters = 0x49494949; + if (!strcmp(model,"DMC-GH1")) break; zero_is_bad = 1; adobe_coeff ("Panasonic","DMC-G1"); break; case 4172: case 4396: -gh1: width -= 28; + width -= 28; filters = 0x49494949; adobe_coeff ("Panasonic","DMC-GH1"); break; case 4290: @@ -7536,13 +7625,14 @@ gh1: width -= 28; height = 1718; width = 2304; filters = 0x16161616; - load_raw = &CLASS packed_12_load_raw; + load_raw = &CLASS packed_load_raw; load_flags = 30; } else if (!strcmp(make,"OLYMPUS")) { height += height & 1; filters = exif_cfa; if (width == 4100) width -= 4; - if (load_raw == &CLASS olympus_e410_load_raw) { + if (load_raw == &CLASS olympus_load_raw) { + tiff_bps = 12; black >>= 4; } else if (!strcmp(model,"E-10") || !strncmp(model,"E-20",4)) { @@ -7568,7 +7658,7 @@ gh1: width -= 28; width = 3072; filters = 0x61616161; data_offset = 0x1a00; - load_raw = &CLASS packed_12_load_raw; + load_raw = &CLASS packed_load_raw; } else if (!strcmp(model,"DSC-F828")) { width = 3288; left_margin = 5; @@ -7588,6 +7678,8 @@ gh1: width -= 28; order = 0x4d4d; } else if (!strcmp(model,"DSLR-A100")) { height--; + width = ++raw_width; + filters = 0x61616161; } else if (!strcmp(model,"DSLR-A350")) { height -= 4; } else if (!strcmp(model,"PIXL")) { @@ -7597,7 +7689,12 @@ gh1: width -= 28; } else if (!strcmp(model,"C603v")) { height = 480; width = 640; - goto c603v; + if (fsize < 614400 || find_green (16, 16, 3840, 5120) < 25) goto c603v; + strcpy (model,"KAI-0340"); + height -= 3; + data_offset = 3840; + order = 0x4949; + load_raw = &CLASS unpacked_load_raw; } else if (!strcmp(model,"C603y")) { height = 2134; width = 2848; @@ -7626,8 +7723,13 @@ c603: } else if (!strcmp(model,"EASYSHARE Z1015 IS")) { height = 2742; width = 3664; + goto ezshare; + } else if (!strcmp(model,"EasyShare Z980")) { + height = 3006; + width = 4016; +ezshare: data_offset = 0x15000; - load_raw = &CLASS packed_12_load_raw; + load_raw = &CLASS packed_load_raw; } else if (!strcasecmp(make,"KODAK")) { if (filters == UINT_MAX) filters = 0x61616161; if (!strncmp(model,"NC2000",6)) { @@ -7778,7 +7880,8 @@ c603: } else if (!strcmp(model,"QV-5700")) { height = 1924; width = 2576; - load_raw = &CLASS casio_qv5700_load_raw; + raw_width = 3232; + tiff_bps = 10; } else if (!strcmp(model,"QV-R41")) { height = 1720; width = 2312; @@ -7805,6 +7908,27 @@ c603: height = 1960; width = 2570; raw_width = 3904; + } else if (!strcmp(model,"EX-Z60")) { + height = 2145; + width = 2833; + raw_width = 3584; + filters = 0x16161616; + tiff_bps = 10; + } else if (!strcmp(model,"EX-Z75")) { + height = 2321; + width = 3089; + raw_width = 4672; + maximum = 0xfff; + } else if (!strcmp(model,"EX-Z750")) { + height = 2319; + width = 3087; + raw_width = 4672; + maximum = 0xfff; + } else if (!strcmp(model,"EX-Z850")) { + height = 2468; + width = 3279; + raw_width = 4928; + maximum = 0xfff; } else if (!strcmp(model,"EX-P505")) { height = 1928; width = 2568; @@ -7833,6 +7957,8 @@ c603: } } dng_skip: + if (!tiff_bps) tiff_bps = 12; + if (!maximum) maximum = (1 << tiff_bps) - 1; if (!load_raw || height < 22) is_raw = 0; #ifdef NO_JPEG if (load_raw == &CLASS kodak_jpeg_load_raw) { @@ -8354,7 +8480,7 @@ int CLASS main (int argc, const char **argv) argv[argc] = ""; for (arg=1; (((opm = argv[arg][0]) - 2) | 2) == '+'; ) { opt = argv[arg++][1]; - if ((cp = strchr (sp="nbrkStqmHACg", opt))) + if ((cp = (char *) strchr (sp="nbrkStqmHACg", opt))) for (i=0; i < "114111111422"[cp-sp]-'0'; i++) if (!isdigit(argv[arg+i][0])) { fprintf (stderr,_("Non-numeric argument to \"-%c\"\n"), opt); diff --git a/dcraw.changes b/dcraw.changes index d3b7247..4efe2e4 100644 --- a/dcraw.changes +++ b/dcraw.changes @@ -1,3 +1,17 @@ +------------------------------------------------------------------- +Sun May 2 00:56:47 CEST 2010 - postadal@suse.cz + +- updated to RCS 1.432 + * Support the Canon EOS-1D Mark IV and PowerShots G11 and S90, + Casio EX-Z750, Pentax K-x, Fuji SX200EXR, Sony A550, Sony DSLR-A850, + Canon EOS 7D, Casio EX-Z850, Canon A470, G11, Nikon D3000, + Panasonic FZ35/FZ38, Casio Z60, Casio Z75, Kodak Z980, Pentax K-7, + Olympus X200,D560Z,C350Z + * Correctly crop Nikon D300S photos + * Support camera WB for the Kodak EasyShare Z980 and Z1015 + * Decode all packed 10-bit and 12-bit formats in one function + * Copied color matrices from Adobe DNG Converter 5.4 + ------------------------------------------------------------------- Sun Nov 15 16:39:58 CET 2009 - meissner@suse.de diff --git a/dcraw.spec b/dcraw.spec index 889ec1f..99df412 100644 --- a/dcraw.spec +++ b/dcraw.spec @@ -1,5 +1,5 @@ # -# spec file for package dcraw (Version 1.425) +# spec file for package dcraw (Version 1.432) # # Copyright (c) 2010 SUSE LINUX Products GmbH, Nuernberg, Germany. # @@ -20,7 +20,7 @@ Name: dcraw BuildRequires: libjpeg-devel liblcms-devel -Version: 1.425 +Version: 1.432 Release: 1 License: PERMISSIVE-OSI-COMPLIANT Group: Productivity/Graphics/Convertors diff --git a/parse.c b/parse.c index db6027d..dd33e11 100644 --- a/parse.c +++ b/parse.c @@ -5,8 +5,8 @@ This program displays raw metadata for all raw photo formats. It is free for all uses. - $Revision: 1.68 $ - $Date: 2009/03/10 00:58:51 $ + $Revision: 1.69 $ + $Date: 2009/08/28 22:52:20 $ */ #include @@ -357,6 +357,7 @@ int parse_tiff_ifd (int base, int level) case 29185: sony_length = get4(); break; case 29217: sony_key = get4(); break; case 33424: + case 65024: puts("Kodak private data:"); fseek (ifp, get4()+base, SEEK_SET); parse_tiff_ifd (base, level+1);