Accepting request 65045 from home:adra:branches:graphics

OBS-URL: https://build.opensuse.org/request/show/65045
OBS-URL: https://build.opensuse.org/package/show/graphics/dcraw?expand=0&rev=14
This commit is contained in:
Adrian Schröter 2011-03-25 07:35:57 +00:00 committed by Git OBS Bridge
parent 399a642cf2
commit dbdc8cfe56
15 changed files with 1417 additions and 9494 deletions

629
README
View File

@ -2,14 +2,15 @@ http://www.cybercom.net/~dcoffin/dcraw/:
[1]Back to Dave Coffin's Home Page
[2]Live free or die / DCRAW / New Hampshire
[2]Live free or die / DCRAW / New Hampshire
[3]en Esperanto
[4]em Portugues
[5]na russkom
[4]em Português
[5]на русском
[6]па-беларуску
Welcome! If you are wondering how to connect your digital camera and
download images to a Linux PC, go to the [6]gPhoto homepage. My
download images to a Linux PC, go to the [7]gPhoto homepage. My
software is for processing those images after downloading them.
If you're downloading JPEG files, you don't need my software at all.
@ -34,14 +35,13 @@ http://www.cybercom.net/~dcoffin/dcraw/:
decodes any raw image from any digital camera on any computer running
any operating system.
That program is called [7]dcraw (pronounced "dee-see-raw"), and it's
That program is called [8]dcraw (pronounced "dee-see-raw"), and it's
become a standard tool within and without the Open Source world. It's
small (about 8000 lines), portable (standard C libraries only), free
(both "gratis" and "libre"), and when used skillfully, produces
[8]better quality [9]output than the tools provided by the camera
vendor.
(both "gratis" and "libre"), and when used skillfully, produces better
quality output than the tools provided by the camera vendor.
[10]Here's my resume. I do freelance consulting related to dcraw, and
[9]Here's my resume. I do freelance consulting related to dcraw, and
I'm also available for full-time software work in the Northeast USA.
I can be reached by sending e-mail to cybercom dot net with the
@ -49,12 +49,12 @@ http://www.cybercom.net/~dcoffin/dcraw/:
News and Interviews
[11]Essay for Digital Outback Photo, 25 April 2003
[12]Article in News.com, 21 April 2005
[13]Interview with Digital Photography Review, 27 April 2005
[14]Dcraw mentioned in Editors Guild magazine, July/August 2005
[15]Interview with Thorsten Schnebeck, 10 June 2006
[16]Interview with Ladinamo, 16 June 2006
[10]Essay for Digital Outback Photo, 25 April 2003
[11]Article in News.com, 21 April 2005
[12]Interview with Digital Photography Review, 27 April 2005
[13]Dcraw mentioned in Editors Guild magazine, July/August 2005
[14]Interview with Thorsten Schnebeck, 10 June 2006
[15]Interview with Ladinamo, 16 June 2006
My Code
@ -68,58 +68,58 @@ http://www.cybercom.net/~dcoffin/dcraw/:
"fuji_green", "fujiturn", and "fujiturn16". My shell scripts are
dangerous and should only be installed in a "doc" directory without
execute permission.
* [17]dcraw.c -- decodes raw photos, extracts thumbnails, and
* [16]dcraw.c -- decodes raw photos, extracts thumbnails, and
displays metadata
Supports 361 cameras at last count. Compile with "gcc -o dcraw -O4
Supports 402 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!
* [19]UNIX manpage for dcraw
Don't complain that 16-bit output is too dark -- read the [17]FAQ!
* [18]UNIX manpage for dcraw
This is dcraw's official user documentation, updated in lockstep
with the source code.
* [20]rawphoto.c -- basic plugin for GIMP 1.2 & 2.0
* [19]rawphoto.c -- basic plugin for GIMP 1.2 & 2.0
After installing "dcraw", do "gimptool --install rawphoto.c". My
plugin provides a simple dialog box for loading raw files into the
Gimp. [21]Udi Fuchs and [22]Joseph Heled have written much nicer
Gimp. [20]Udi Fuchs and [21]Joseph Heled have written much nicer
plugins, with live preview, histograms, and color curves.
* [23].badpixels -- my camera's "hot pixels"
* [22].badpixels -- my camera's "hot pixels"
This file tells dcraw which pixels have died and when, so that it
can interpolate around them.
* [24]dcraw.c,v -- complete unabridged RCS file
* [23]dcraw.c,v -- complete unabridged RCS file
This file contains the entire history of dcraw.c since its
conception on February 23, 1997. If you don't have the RCS toolkit,
[25]download it here.
* [26]parse.c -- read image data structures
[24]download it here.
* [25]parse.c -- read image data structures
This program displays CIFF and TIFF data structures in a very
cryptic format.
* [27]clean_crw.c -- clean Canon CRW files
* [26]clean_crw.c -- clean Canon CRW files
Recovered or undeleted CRW files often have junk appended to them
that makes them unreadable. This program safely cleans CRW files.
* [28]fujiturn.c -- rotate Fuji Super CCD images
* [27]fujiturn.c -- rotate Fuji Super CCD images
An alternative to dcraw's built-in Fuji rotation.
* [29]fuji_green.c -- convert Fuji green pixels to PGM
* [28]fuji_green.c -- convert Fuji green pixels to PGM
A side benefit of the Fuji Super CCD design is that its green
pixels make nice greyscale images.
For hackers only:
* [30]decompress.c is a simple reference decompressor for CRW files.
* [31]sony_clear.c decrypts SRF files from the Sony DSC-F828.
* [29]decompress.c is a simple reference decompressor for CRW files.
* [30]sony_clear.c decrypts SRF files from the Sony DSC-F828.
Internationalization
To build and install multilingual dcraw in Linux, download the latest
tarball [32]from this directory and run the "install" script. The
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, [46]Danish, and Chinese (both [47]Traditional and
[48]Simplified).
tarball [31]from this directory and run the "install" script. The
currently supported languages are [32]Esperanto, [33]Russian,
[34]French, [35]Italian, [36]German, [37]Portuguese, [38]Spanish,
[39]Dutch, [40]Polish, [41]Hungarian, [42]Czech, [43]Swedish,
[44]Catalan, [45]Danish, and Chinese (both [46]Traditional and
[47]Simplified).
To build a unilingual, self-contained DCRAW.EXE for DOS/Windows, use a
source file [49]from this directory instead.
source file [48]from this directory instead.
To add another language, send me translations of [50]this manpage and
[51]this message table in UTF-8 encoding. Translate only from my
To add another language, send me translations of [49]this manpage and
[50]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.
@ -150,113 +150,108 @@ 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:
* [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
* [51]ACDSee
* [52]Adobe Photoshop
* [53]BR's PhotoArchiver by Baard Riiber
* [54]BreezeBrowser by Chris Breeze
* [55]Conceiva Lightbox
* [56]cPicture by Jürgen 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]GraphicConverter by Thorsten Lemke
* [64]GTKRawGallery by Daniele Isca
* [65]GVBox from JCO Consulting
* [66]HDR Shop
* [67]ImageLab from Aragon System
* [68]Imagina by Rob Baker
* [69]IrfanView by Irfan Skiljan
* [70]IRIS image processor for astronomers
* [71]Lightbox by Josh Anon
* [72]LightZone by Anton Kast
* [73]LRViewer by Marc Rochkind
* [74]MediaRECOVER File Recovery Software
* [75]Mixpo by Mixpo Portfolio Broadcasting Inc.
* [76]Photo Acute by Almalence
* [77]Photo Companion by Jeff Moore
* [78]Photo Jockey by Davie Lee Reed who also wrote a [79]dcraw
interface for Delphi programmers.
* [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
* [80]Photo Organizer by Balint Kis
* [81]PhotoRescue from DataRescue
* [82]PhotoReviewer by Ben Haller
* [83]Photovault by Harri Kaimio
* [84]Picasa from Google
* [85]Picture Arena by Felix Schwarz
* [86]PixInsight by Pleiades Software
* [87]PolyView by Polybytes
* [88]RAW Developer by Iridient Digital
* [89]Raw Magick
* [90]RawDrop by Frank Siegert
* [91]RawTherapee by RT Team
* [92]Serif PhotoPlus, PanoramaPlus, and AlbumPlus
* [93]SharpRaw by Duane DeSieno
* [94]SilverFast DCPro by LaserSoft Imaging
* [95]StudioLine Photo by H&M Software
* [96]ViewIt by Zdzislaw Losvik
* [97]Viewer n5 by Dmitry Fedorov
* [98]VueScan by Ed Hamrick
* [99]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 [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.
executables [100]on his website. And Manuel Llorens has provided
a [101]huge cache of Windows executables here. Dcraw has also
been ported to [102]Amiga, [103]MorphOS, [104]BeOS, [105]OS/2,
and [106]RISC OS.
If you're familiar with the DOS command line but don't know C,
you can install this [115]free C compiler for Windows and
you can install this [107]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 [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.
Ostensibly to stop memory leaks, Microsoft decided that any
program compiled to the old MS-DOS API should be confined to
32MB of memory. This limitation can be removed with some
combination of service packs and registry hacks, or you can
compile dcraw to use the newer Win32 API. Thomas Nicely (of
Pentium FDIV fame) has a [108]page describing the problem and
various workarounds.
How can I read the EXIF data (shutter speed, aperture, etc.)?
[117]Phil Harvey's ExifTool provides a unified Perl-based EXIF
[109]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 [118]this simple program for
Dcraw only supports cameras. Try [110]this simple program for
scanners.
How can I read Nikon Dust Off images (NDF files)?
[119]Use this program.
[111]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
[120]TIFF spec, the [121]TIFF/EP spec, the [122]Adobe DNG spec,
the [123]CIFF (CRW) spec, and the [124]X3F spec.
[112]TIFF spec, the [113]TIFF/EP spec, the [114]Adobe DNG spec,
the [115]CIFF (CRW) spec, and the [116]X3F spec.
Where can I get an assortment of raw photos to test my software?
Try [125]raw.fotosite.pl, [126]www.rawsamples.ch, and [127]Glass
Lantern RAWpository. A "full review" at [128]Imaging Resource
Try [117]raw.fotosite.pl, [118]www.rawsamples.ch, and [119]Glass
Lantern RAWpository. A "full review" at [120]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 [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.
Download [121]LibTIFF v3.8.2 and apply [122]this patch. Then use
[123]this C program as a template for converting your photos to
valid [124]Adobe DNG files.
Why are dcraw output images larger than camera JPEGs?
Any algorithm that combines each pixel with its neighbors is
@ -277,11 +272,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 [133]Photoshop and
[134]CinePaint, but it's no good for most image viewers.
professional image editors such as [125]Photoshop and
[126]CinePaint, but it's no good for most image viewers.
What does the "-f" (four color RGB) option do?
If you see patterns like [135]this or [136]this in your output
If you see patterns like [127]this or [128]this in your output
images, first try "dcraw -a". If these patterns persist, use
"dcraw -f" to get rid of them.
@ -295,8 +290,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 [137]Netpbm toolkit in these examples.
[138]ImageMagick also does command-line format conversions. Both
I used the [129]Netpbm toolkit in these examples.
[130]ImageMagick also does command-line format conversions. Both
are free.
Why don't you implement dcraw as a library?
@ -310,7 +305,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 [139]explains this
it as a separate process. Eric Raymond [131]explains this
technique here.
Why are there false colors along edges within the image?
@ -326,7 +321,7 @@ dcraw -c crw_0001.crw | cjpeg > crw_0001.jpeg
Variable Number of Gradients (VNG), Patterned Pixel Grouping
(PPG), and Adaptive Homogeneity-Directed (AHD).
[140]The Foveon X3 Capture chip requires a different kind of
[132]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
@ -334,41 +329,43 @@ 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
[141]CHDK hack.
[133]CHDK hack.
For some Nikon Coolpix cameras, you need to enable a
[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).
[134]special "DIAG RAW" mode.
For Casio cameras, see [135]Maurice Delaney's website or read
[136]this discussion on dpreview.
For the Minolta DiMAGE G400, G500, G530, or G600, go [137]here
(in Russian) or [138]here (in English).
For the Minolta DiMAGE Z2 and Nikon Coolpix 2100/3100/3700,
[147]go here.
For SMaL cameras, see the [148]camerahacking Forum.
For Agfa and Samsung cameras, [149]go here.
[139]go here.
For SMaL cameras, see the [140]camerahacking Forum.
For Agfa and Samsung cameras, [141]go here.
For other cameras, refer to the User's Manual.
Does dcraw work with my camera?
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
[150]YouSendIt, [151]RapidShare, [152]Sendshack, [153]ShareFile,
[154]sendspace, [155]File-Upload, or [156]Megaupload.
try dcraw anyway. If it doesn't work perfectly, don't just sit
quietly waiting for my next version. Ask me if I need any raw
photos, or go ahead and post a photo to your website and e-mail
me the URL. If you don't have a website, use [142]YouSendIt,
[143]RapidShare, [144]Sendshack, [145]ShareFile, [146]sendspace,
or [147]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 [157]Wolf Faust, [158]Calibr8, [159]CMP,
[160]GretagMacbeth, or other calibrated color chart. Follow this
photo of a [148]Wolf Faust, [149]Calibr8, [150]CMP,
[151]GretagMacbeth, or other calibrated color chart. Follow this
checklist:
+ Use a real chart, not a printout or screen image.
+ Wait for sunny weather, local noon +- two hours.
+ Wait for sunny weather, local noon ± two hours.
+ Carefully brush any dust off the chart.
+ Tilt the chart 90DEG to the camera and 45DEG to the sun to
avoid specular reflections.
+ Tilt the chart 90° to the camera and 45° to the sun to avoid
specular reflections.
+ Set the camera two meters away and use telephoto zoom.
+ Use the lowest ISO setting.
@ -412,6 +409,7 @@ dcraw -c crw_0001.crw | cjpeg > crw_0001.jpeg
* Canon PowerShot G9
* Canon PowerShot G10
* Canon PowerShot G11
* Canon PowerShot G12
* Canon PowerShot S2 IS (CHDK hack)
* Canon PowerShot S3 IS (CHDK hack)
* Canon PowerShot S5 IS (CHDK hack)
@ -423,8 +421,11 @@ dcraw -c crw_0001.crw | cjpeg > crw_0001.jpeg
* Canon PowerShot S60
* Canon PowerShot S70
* Canon PowerShot S90
* Canon PowerShot S95
* Canon PowerShot SX1 IS
* Canon PowerShot SX110 IS (CHDK hack)
* Canon PowerShot SX120 IS (CHDK hack)
* Canon PowerShot SX20 IS (CHDK hack)
* Canon EOS D30
* Canon EOS D60
* Canon EOS 5D
@ -440,6 +441,7 @@ dcraw -c crw_0001.crw | cjpeg > crw_0001.jpeg
* Canon EOS 400D / Digital Rebel XTi / Kiss Digital X
* Canon EOS 450D / Digital Rebel XSi / Kiss Digital X2
* Canon EOS 500D / Digital Rebel T1i / Kiss Digital X3
* Canon EOS 550D / Digital Rebel T2i / Kiss Digital X4
* Canon EOS 1000D / Digital Rebel XS / Kiss Digital F
* Canon EOS D2000C
* Canon EOS-1D
@ -467,6 +469,8 @@ dcraw -c crw_0001.crw | cjpeg > crw_0001.jpeg
* Casio EX-Z75
* Casio EX-Z750
* Casio EX-Z850
* Casio EX-Z1050
* Casio EX-Z1080
* Casio Exlim Pro 505
* Casio Exlim Pro 600
* Casio Exlim Pro 700
@ -493,19 +497,21 @@ dcraw -c crw_0001.crw | cjpeg > crw_0001.jpeg
* Fuji FinePix S9000/S9500
* Fuji FinePix S9100/S9600
* Fuji FinePix S200EXR
* Fuji FinePix HS10/HS11
* Fuji IS-1
* Hasselblad CFV
* Hasselblad H3D
* Hasselblad H4D
* Hasselblad V96C
* Imacon Ixpress 16-megapixel
* Imacon Ixpress 22-megapixel
* Imacon Ixpress 39-megapixel
* ISG 2020x1520
* Kodak DC20 (see [161]Oliver Hartman's page)
* Kodak DC25 (see [162]Jun-ichiro Itoh's page)
* Kodak DC20
* Kodak DC25
* Kodak DC40
* Kodak DC50
* Kodak DC120 (also try [163]kdc2tiff)
* Kodak DC120 (also try [152]kdc2tiff)
* Kodak DCS200
* Kodak DCS315C
* Kodak DCS330C
@ -537,6 +543,7 @@ dcraw -c crw_0001.crw | cjpeg > crw_0001.jpeg
* Kodak P850
* Kodak P880
* Kodak Z980
* Kodak Z981
* Kodak Z1015
* Kodak KAI-0340
* Konica KD-400Z
@ -590,6 +597,7 @@ dcraw -c crw_0001.crw | cjpeg > crw_0001.jpeg
* Nikon D2X
* Nikon D2Xs
* Nikon D3
* Nikon D3s
* Nikon D3X
* Nikon D40
* Nikon D40X
@ -605,7 +613,9 @@ dcraw -c crw_0001.crw | cjpeg > crw_0001.jpeg
* Nikon D300s
* Nikon D700
* Nikon D3000
* Nikon D3100
* Nikon D5000
* Nikon D7000
* Nikon E700 ("DIAG RAW" hack)
* Nikon E800 ("DIAG RAW" hack)
* Nikon E880 ("DIAG RAW" hack)
@ -626,8 +636,10 @@ dcraw -c crw_0001.crw | cjpeg > crw_0001.jpeg
* Nikon E8700
* Nikon E8800
* Nikon Coolpix P6000
* Nikon Coolpix P7000
* Nikon Coolpix S6 ("DIAG RAW" hack)
* Nokia N95
* Nokia X2
* Olympus C3030Z
* Olympus C5050Z
* Olympus C5060WZ
@ -639,6 +651,7 @@ dcraw -c crw_0001.crw | cjpeg > crw_0001.jpeg
* Olympus X200,D560Z,C350Z
* Olympus E-1
* Olympus E-3
* Olympus E-5
* Olympus E-10
* Olympus E-20
* Olympus E-30
@ -652,6 +665,9 @@ dcraw -c crw_0001.crw | cjpeg > crw_0001.jpeg
* Olympus E-520
* Olympus E-620
* Olympus E-P1
* Olympus E-P2
* Olympus E-PL1
* Olympus E-PL2
* Olympus SP310
* Olympus SP320
* Olympus SP350
@ -665,16 +681,23 @@ dcraw -c crw_0001.crw | cjpeg > crw_0001.jpeg
* Panasonic DMC-FZ28
* Panasonic DMC-FZ30
* Panasonic DMC-FZ35/FZ38
* Panasonic DMC-FZ40
* Panasonic DMC-FZ50
* Panasonic DMC-FZ100
* Panasonic DMC-FX150
* Panasonic DMC-G1
* Panasonic DMC-G2
* Panasonic DMC-GF1
* Panasonic DMC-GF2
* Panasonic DMC-GH1
* Panasonic DMC-GH2
* Panasonic DMC-L1
* Panasonic DMC-L10
* Panasonic DMC-LC1
* Panasonic DMC-LX1
* Panasonic DMC-LX2
* Panasonic DMC-LX3
* Panasonic DMC-LX5
* Pentax *ist D
* Pentax *ist DL
* Pentax *ist DL2
@ -687,11 +710,14 @@ dcraw -c crw_0001.crw | cjpeg > crw_0001.jpeg
* Pentax K200D
* Pentax K2000/K-m
* Pentax K-x
* Pentax K-r
* Pentax K-5
* Pentax K-7
* Pentax Optio S
* Pentax Optio S4
* Pentax Optio 33WR
* Pentax Optio 750Z
* Pentax 645D
* Phase One LightPhase
* Phase One H 10
* Phase One H 20
@ -705,8 +731,14 @@ dcraw -c crw_0001.crw | cjpeg > crw_0001.jpeg
* Polaroid x530
* Rollei d530flex
* RoverShot 3320af
* Samsung EX1
* Samsung GX-1S
* Samsung GX-10
* Samsung GX10
* Samsung GX20
* Samsung NX10
* Samsung NX100
* Samsung WB550
* Samsung WB2000
* Samsung S85 (hacked)
* Samsung S850 (hacked)
* Sarnoff 4096x5440
@ -729,11 +761,17 @@ dcraw -c crw_0001.crw | cjpeg > crw_0001.jpeg
* Sony DSLR-A330
* Sony DSLR-A350
* Sony DSLR-A380
* Sony DSLR-A450
* Sony DSLR-A500
* Sony DSLR-A550
* Sony DSLR-A580
* Sony DSLR-A700
* Sony DSLR-A850
* Sony DSLR-A900
* Sony NEX-3
* Sony NEX-5
* Sony SLT-A33
* Sony SLT-A55V
* Sony XCD-SX910CR
* STV680 VGA
__________________________________________________________________
@ -745,161 +783,150 @@ References
3. http://www.cybercom.net/~dcoffin/dcraw/index_eo.html
4. http://www.cybercom.net/~dcoffin/dcraw/index_pt.html
5. http://www.cybercom.net/~dcoffin/dcraw/index_ru.html
6. http://gphoto.sourceforge.net/
7. http://www.cybercom.net/~dcoffin/dcraw/dcraw.c
8. http://www.insflug.org/raw/
9. http://www.aim-dtp.net/aim/digicam/dcraw/
10. http://www.cybercom.net/~dcoffin/resume.html
11. http://www.outbackphoto.com/artofraw/raw_07/essay.html
12. http://news.com.com/Nikons+photo+encryption+reported+broken/2100-1030_3-5679848.html
13. http://www.dpreview.com/news/0504/05042701davecoffininterview.asp
14. http://www.editorsguild.com/v2/magazine/archives/0705/cover_story.htm
15. http://www.schnebeck.de/interview-with-dave-coffin-creator-of-dcraw
16. http://www.ladinamo.org/english/raw-format-the-captive-photo.php
17. http://www.cybercom.net/~dcoffin/dcraw/dcraw.c
18. http://www.cybercom.net/~dcoffin/dcraw/#faq
19. http://www.cybercom.net/~dcoffin/dcraw/dcraw.1.html
20. http://www.cybercom.net/~dcoffin/dcraw/rawphoto.c
21. http://ufraw.sourceforge.net/
22. http://pages.quicksilver.net.nz/pepe/
23. http://www.cybercom.net/~dcoffin/dcraw/.badpixels
24. http://www.cybercom.net/~dcoffin/dcraw/RCS/dcraw.c,v
25. http://www.cs.purdue.edu/homes/trinkle/RCS/
26. http://www.cybercom.net/~dcoffin/dcraw/parse.c
27. http://www.cybercom.net/~dcoffin/dcraw/clean_crw.c
28. http://www.cybercom.net/~dcoffin/dcraw/fujiturn.c
29. http://www.cybercom.net/~dcoffin/dcraw/fuji_green.c
30. http://www.cybercom.net/~dcoffin/dcraw/decompress.c
31. http://www.cybercom.net/~dcoffin/dcraw/sony_clear.c
32. http://www.cybercom.net/~dcoffin/dcraw/archive/
33. http://www.cybercom.net/~dcoffin/dcraw/dcraw_eo.1.html
34. http://www.cybercom.net/~dcoffin/dcraw/dcraw_ru.1.html
35. http://www.cybercom.net/~dcoffin/dcraw/dcraw_fr.1.html
36. http://www.cybercom.net/~dcoffin/dcraw/dcraw_it.1.html
37. http://www.cybercom.net/~dcoffin/dcraw/dcraw_de.1.html
38. http://www.cybercom.net/~dcoffin/dcraw/dcraw_pt.1.html
39. http://www.cybercom.net/~dcoffin/dcraw/dcraw_es.1.html
40. http://www.cybercom.net/~dcoffin/dcraw/dcraw_nl.1.html
41. http://www.cybercom.net/~dcoffin/dcraw/dcraw_pl.1.html
42. http://www.cybercom.net/~dcoffin/dcraw/dcraw_hu.1.html
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_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/
6. http://www.movavi.com/opensource/dcraw-be
7. http://gphoto.sourceforge.net/
8. http://www.cybercom.net/~dcoffin/dcraw/dcraw.c
9. http://www.cybercom.net/~dcoffin/resume.html
10. http://www.outbackphoto.com/artofraw/raw_07/essay.html
11. http://news.com.com/Nikons+photo+encryption+reported+broken/2100-1030_3-5679848.html
12. http://www.dpreview.com/news/0504/05042701davecoffininterview.asp
13. http://www.editorsguild.com/v2/magazine/archives/0705/cover_story.htm
14. http://www.schnebeck.de/interview-with-dave-coffin-creator-of-dcraw
15. http://www.ladinamo.org/english/raw-format-the-captive-photo.php
16. http://www.cybercom.net/~dcoffin/dcraw/dcraw.c
17. http://www.cybercom.net/~dcoffin/dcraw/#faq
18. http://www.cybercom.net/~dcoffin/dcraw/dcraw.1.html
19. http://www.cybercom.net/~dcoffin/dcraw/rawphoto.c
20. http://ufraw.sourceforge.net/
21. http://homepages.ihug.co.nz/~peps/
22. http://www.cybercom.net/~dcoffin/dcraw/.badpixels
23. http://www.cybercom.net/~dcoffin/dcraw/RCS/dcraw.c,v
24. http://www.cs.purdue.edu/homes/trinkle/RCS/
25. http://www.cybercom.net/~dcoffin/dcraw/parse.c
26. http://www.cybercom.net/~dcoffin/dcraw/clean_crw.c
27. http://www.cybercom.net/~dcoffin/dcraw/fujiturn.c
28. http://www.cybercom.net/~dcoffin/dcraw/fuji_green.c
29. http://www.cybercom.net/~dcoffin/dcraw/decompress.c
30. http://www.cybercom.net/~dcoffin/dcraw/sony_clear.c
31. http://www.cybercom.net/~dcoffin/dcraw/archive/
32. http://www.cybercom.net/~dcoffin/dcraw/dcraw_eo.1.html
33. http://www.cybercom.net/~dcoffin/dcraw/dcraw_ru.1.html
34. http://www.cybercom.net/~dcoffin/dcraw/dcraw_fr.1.html
35. http://www.cybercom.net/~dcoffin/dcraw/dcraw_it.1.html
36. http://www.cybercom.net/~dcoffin/dcraw/dcraw_de.1.html
37. http://www.cybercom.net/~dcoffin/dcraw/dcraw_pt.1.html
38. http://www.cybercom.net/~dcoffin/dcraw/dcraw_es.1.html
39. http://www.cybercom.net/~dcoffin/dcraw/dcraw_nl.1.html
40. http://www.cybercom.net/~dcoffin/dcraw/dcraw_pl.1.html
41. http://www.cybercom.net/~dcoffin/dcraw/dcraw_hu.1.html
42. http://www.cybercom.net/~dcoffin/dcraw/dcraw_cs.1.html
43. http://www.cybercom.net/~dcoffin/dcraw/dcraw_sv.1.html
44. http://www.cybercom.net/~dcoffin/dcraw/dcraw_ca.1.html
45. http://www.cybercom.net/~dcoffin/dcraw/dcraw_da.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.lemkesoft.com/
64. http://sourceforge.net/projects/gtkrawgallery/
65. http://jcoconsulting.com/index.asp?Section=GVOCX
66. http://www.hdrshop.com/
67. http://www.aragonsystem.com/
68. http://www.planetimagina.com/
69. http://www.irfanview.com/
70. http://www.astrosurf.com/buil/us/iris/iris.htm
71. http://www.lightboxsoftware.com/
72. http://www.lightcrafts.com/
73. http://imageingester.com/
74. http://www.mediarecover.com/
75. http://www.mixpo.com/
76. http://www.photoacute.com/
77. http://www.wildcape.com/
78. http://photojockey.com/
79. http://smatters.com/dcraw/
80. http://www.k-i-s.net/
81. http://www.datarescue.com/photorescue/
82. http://www.sticksoftware.com/software/PhotoReviewer.html
83. http://www.photovault.org/
84. http://www.picasa.com/
85. http://www.picturearena.com/
86. http://pleiades-astrophoto.com/
87. http://www.polybytes.com/
88. http://www.iridientdigital.com/
89. http://www.rawmagick.com/
90. http://www.wizards.de/rawdrop
91. http://www.rawtherapee.com/
92. http://www.serif.com/
93. http://www.logicaldesigns.com/
94. http://www.silverfast.com/
95. http://www.studioline.net/
96. http://www.hexcat.com/viewit/
97. http://www.dimin.net/software/viewer/
98. http://www.hamrick.com/
99. http://www.xara.com/products/xtreme/
100. http://www.insflug.org/raw/
101. http://www.rawness.es/dcraw/?lang=en
102. http://aminet.net/search?query=dcraw
103. http://amis.flatrate.ru/dcraw/
104. http://www.pidcock.co.uk/beos/index.html
105. http://hobbes.nmsu.edu/h-search.php?key=dcraw
106. http://www.riscos.info/unix/indexes/graphics.html
107. http://www.delorie.com/djgpp/
108. http://www.trnicely.net/misc/vista.html
109. http://www.sno.phy.queensu.ca/~phil/exiftool/
110. http://www.cybercom.net/~dcoffin/dcraw/scan.c
111. http://www.cybercom.net/~dcoffin/dcraw/read_ndf.c
112. http://partners.adobe.com/asn/developer/PDFS/TN/TIFF6.pdf
113. http://www.cybercom.net/~dcoffin/N4378.pdf
114. http://www.adobe.com/products/dng/pdfs/dng_spec.pdf
115. http://xyrion.org/ciff/
116. http://web.archive.org/web/20070317042320/http://www.x3f.info/technotes/FileDocs/X3F_Format.pdf
117. http://raw.fotosite.pl/
118. http://www.rawsamples.ch/
119. http://www.glasslantern.com/RAWpository/
120. http://www.imaging-resource.com/MFR1.HTM
121. http://dl.maptools.org/dl/libtiff/tiff-3.8.2.tar.gz
122. http://www.cybercom.net/~dcoffin/dcraw/libtiff.patch
123. http://www.cybercom.net/~dcoffin/dcraw/elphel_dng.c
124. http://www.adobe.com/products/dng/main.html
125. http://www.adobe.com/products/photoshop/main.html
126. http://cinepaint.sourceforge.net/
127. http://www.cybercom.net/~dcoffin/dcraw/ahd_maze.png
128. http://www.cybercom.net/~dcoffin/dcraw/vng_grid.png
129. http://netpbm.sourceforge.net/
130. http://www.imagemagick.org/
131. http://www.faqs.org/docs/artu/multiprogramchapter.html
132. http://www.dpreview.com/news/0202/02021101foveonx3.asp
133. http://digicanon.narod.ru/
134. http://e2500.narod.ru/raw_format_e.htm
135. http://www.inweb.ch/foto/rawformat.html
136. http://forums.dpreview.com/forums/read.asp?forum=1015&message=4961779
137. http://myfototest.narod.ru/
138. http://forums.dpreview.com/forums/read.asp?forum=1024&message=11773287
139. http://tester13.nm.ru/nikon/
140. http://camerahacks.10.forumer.com/
141. http://forums.dpreview.com/forums/read.asp?forum=1001&message=28484239
142. http://yousendit.com/
143. http://rapidshare.com/
144. http://sendshack.com/
145. http://www.sharefile.com/
146. http://www.sendspace.com/
147. http://www.megaupload.com/
148. http://www.targets.coloraid.de/
149. http://www.calibr8.com/
150. http://www.cmp-color.fr/eng%20digital%20target.html
151. http://www.xrite.com/product_overview.aspx?ID=820
152. http://kdc2tiff.sourceforge.net/

80
clean_crw.c Normal file
View File

@ -0,0 +1,80 @@
/*
Because they are parsed from the end, Canon CRW files
become unreadable if garbage data is appended to them, as
often happens when files are recovered from damaged media.
This program truncates CRW files to the correct size.
Copyright 2005 by Dave Coffin, dcoffin a cybercom o net
Free for all uses.
$Revision$
$Date$
*/
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
unsigned char *buffer;
int get4 (int i)
{
if (buffer[0] == 'I')
return buffer[i+3] << 24 | buffer[i+2] << 16 | buffer[i+1] << 8 | buffer[i];
else
return buffer[i] << 24 | buffer[i+1] << 16 | buffer[i+2] << 8 | buffer[i+3];
}
int main (int argc, char **argv)
{
int arg, size, end, diff, status=1;
unsigned char *fname;
FILE *fp;
if (argc == 1)
fprintf (stderr, "Usage: %s crw_0001.crw crw_0002.crw ...\n", argv[0]);
for (arg=1; arg < argc; arg++) {
status = 1;
fp = fopen (argv[arg], "rb");
fseek (fp, 0, SEEK_END);
size = ftell(fp);
buffer = malloc (size + strlen(argv[arg]) + 10);
if (!buffer) {
fprintf (stderr, "Cannot allocate memory!\n");
return 2;
}
fname = buffer + size;
sprintf (fname, "%s.clean", argv[arg]);
fseek (fp, 0, SEEK_SET);
fread (buffer, 1, size, fp);
fclose (fp);
if (strncmp (buffer, "II\x1a\0\0\0HEAPCCDR", 14) &&
strncmp (buffer, "MM\0\0\0\x1aHEAPCCDR", 14)) {
fprintf (stderr, "%s is not a CRW file!\n", argv[arg]);
free (buffer);
continue;
}
for (end=size; end > 0xa0000; end--) {
diff = end - get4(end-4);
if (diff > 50 && diff < 120 && diff % 10 == 2) {
status = 0;
break;
}
}
if (status)
fprintf (stderr, "Failed to clean %s\n", argv[arg]);
else {
if ((fp = fopen (fname, "wb"))) {
fprintf (stderr, "Writing %s\n", fname);
fwrite (buffer, 1, end, fp);
fclose (fp);
} else {
perror (fname);
status = 1;
}
}
free (buffer);
}
return status;
}

3
dcraw-9.06.tar.bz2 Normal file
View File

@ -0,0 +1,3 @@
version https://git-lfs.github.com/spec/v1
oid sha256:354ebf41940183fcb93dfd143fdbec49155733b97bafdc6906d20fc82143382a
size 141913

View File

@ -1,5 +1,5 @@
--- dcraw.c.orig 2010-05-02 01:23:33.000000000 +0200
+++ dcraw.c 2010-05-02 01:24:00.000000000 +0200
--- dcraw.c.orig 2011-01-29 09:43:38.000000000 +0200
+++ dcraw.c 2011-03-20 22:53:08.976000042 +0200
@@ -217,7 +217,7 @@
#define BAYER2(row,col) \
image[((row) >> shrink)*iwidth + ((col) >> shrink)][fc(row,col)]
@ -75,7 +75,7 @@
{
if (fread (pixel, 2, count, ifp) < count) derror();
if ((order == 0x4949) == (ntohs(0x1234) == 0x1234))
@@ -860,7 +860,7 @@
@@ -846,7 +846,7 @@
return diff;
}
@ -84,16 +84,16 @@
{
int col, c, diff, pred, spred=0;
ushort mark=0, *row[3];
@@ -899,7 +899,7 @@
@@ -885,7 +885,7 @@
return row[2];
}
-void CLASS lossless_jpeg_load_raw()
+static void CLASS lossless_jpeg_load_raw()
{
int jwide, jrow, jcol, val, jidx, i, j, row=0, col=0, nblack=0;
double dark[2] = { 0,0 };
@@ -3710,6 +3710,8 @@
int jwide, jrow, jcol, val, jidx, c, i, j, row=0, col=0;
struct jhead jh;
@@ -3713,6 +3713,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;
@@ -3779,7 +3781,7 @@
@@ -3782,7 +3784,7 @@
if (half_size) filters = 0;
}
@ -111,7 +111,7 @@
{
unsigned row, col, y, x, f, c, sum[8];
@@ -4067,6 +4069,7 @@
@@ -4070,6 +4072,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) {
@@ -8120,8 +8123,14 @@
@@ -8308,8 +8311,14 @@
_("Converting to %s colorspace...\n"), name[output_color-1]);
memset (histogram, 0, sizeof histogram);
@ -127,7 +127,7 @@
- for (col=0; col < width; col++, img+=4) {
+
+#pragma omp parallel for \
+ default(none) \
+ default(none) \
+ shared(height, width, image, raw_color, out_cam, colors, document_mode, filters, histogram) \
+ private(row, col, out, c, img)
+ for (row = 0; row < height; row++) {
@ -136,7 +136,7 @@
if (!raw_color) {
out[0] = out[1] = out[2] = 0;
FORCC {
@@ -8133,8 +8142,12 @@
@@ -8321,8 +8330,12 @@
}
else if (document_mode)
img[0] = img[FC(row,col)];

278
dcraw.1
View File

@ -1,278 +0,0 @@
.\"
.\" Man page for dcraw
.\"
.\" Copyright (c) 2009 by David Coffin
.\"
.\" You may distribute without restriction.
.\"
.\" David Coffin
.\" dcoffin a cybercom o net
.\" http://www.cybercom.net/~dcoffin
.\"
.TH dcraw 1 "May 14, 2009"
.LO 1
.SH NAME
dcraw - command-line decoder for raw digital photos
.SH SYNOPSIS
.B dcraw
[\fIOPTION\fR]... [\fIFILE\fR]...
.SH DESCRIPTION
.B dcraw
decodes raw photos, displays metadata, and extracts thumbnails.
.SH GENERAL OPTIONS
.TP
.B -v
Print verbose messages, not just warnings and errors.
.TP
.B -c
Write decoded images or thumbnails to standard output.
.TP
.B -e
Extract the camera-generated thumbnail, not the raw image.
You'll get either a JPEG or a PPM file, depending on the camera.
.TP
.B -z
Change the access and modification times of an AVI, JPEG, TIFF or raw
file to when the photo was taken, assuming that the camera clock
was set to Universal Time.
.TP
.B -i
Identify files but don't decode them.
Exit status is 0 if
.B dcraw
can decode the last file, 1 if it can't.
.B -i -v
shows metadata.
.TP
.B ""
.B dcraw
cannot decode JPEG files!!
.SH REPAIR OPTIONS
.TP
.B -P deadpixels.txt
Read the dead pixel list from this file instead of ".badpixels".
See
.B FILES
for a description of the format.
.TP
.B -K darkframe.pgm
Subtract a dark frame from the raw data. To generate a
dark frame, shoot a raw photo with no light and do
.BR dcraw\ -D\ -4\ -j\ -t\ 0 .
.TP
.B -k darkness
When shadows appear foggy, you need to raise the darkness level.
To measure this, apply
.B pamsumm -mean
to the dark frame generated above.
.TP
.B -S saturation
When highlights appear pink, you need to lower the saturation level.
To measure this, take a picture of something shiny and do
.B dcraw -D -4 -j -c
photo.raw
.B | pamsumm -max
.TP
.B ""
The default darkness and saturation are usually correct.
.TP
.B -n noise_threshold
Use wavelets to erase noise while preserving real detail.
The best threshold should be somewhere between 100 and 1000.
.TP
.B -C red_mag blue_mag
Enlarge the raw red and blue layers by the given factors,
typically 0.999 to 1.001, to correct chromatic aberration.
.TP
.B -H 0
Clip all highlights to solid white (default).
.TP
.B -H 1
Leave highlights unclipped in various shades of pink.
.TP
.B -H 2
Blend clipped and unclipped values together for a gradual fade
to white.
.TP
.B -H 3+
Reconstruct highlights. Low numbers favor whites; high numbers
favor colors. Try
.B -H 5
as a compromise. If that's not good enough, do
.BR -H\ 9 ,
cut out the non-white highlights, and paste them into an image
generated with
.BR -H\ 3 .
.SH COLOR OPTIONS
By default,
.B dcraw
uses a fixed white balance based on a color chart illuminated
with a standard D65 lamp.
.TP
.B -w
Use the white balance specified by the camera.
If this is not found, print a warning and use another method.
.TP
.B -a
Calculate the white balance by averaging the entire image.
.TP
.B -A left top width height
Calculate the white balance by averaging a rectangular area.
First do
.B dcraw\ -j\ -t\ 0
and select an area of neutral grey color.
.TP
.B -r mul0 mul1 mul2 mul3
Specify your own raw white balance.
These multipliers can be cut and pasted from the output of
.BR dcraw\ -v .
.TP
.BR +M " or " -M
Use (or don't use) any color matrix from the camera metadata.
The default is
.B +M
if
.B -w
is set,
.B -M
otherwise.
This option only affects Olympus, Leaf, and Phase One cameras.
.TP
.B -o [0-5]
Select the output colorspace when the
.B -p
option is not used:
.B \t0
\ \ Raw color (unique to each camera)
.br
.B \t1
\ \ sRGB D65 (default)
.br
.B \t2
\ \ Adobe RGB (1998) D65
.br
.B \t3
\ \ Wide Gamut RGB D65
.br
.B \t4
\ \ Kodak ProPhoto RGB D65
.br
.B \t5
\ \ XYZ
.TP
.BR -p\ camera.icm \ [\ -o\ output.icm \ ]
Use ICC profiles to define the camera's raw colorspace and the
desired output colorspace (sRGB by default).
.TP
.B -p embed
Use the ICC profile embedded in the raw photo.
.SH INTERPOLATION OPTIONS
.TP
.B -d
Show the raw data as a grayscale image with no interpolation.
Good for photographing black-and-white documents.
.TP
.B -D
Same as
.BR -d ,
but totally raw (no color scaling).
.TP
.B -h
Output a half-size color image. Twice as fast as
.BR -q\ 0 .
.TP
.B -q 0
Use high-speed, low-quality bilinear interpolation.
.TP
.B -q 1
Use Variable Number of Gradients (VNG) interpolation.
.TP
.B -q 2
Use Patterned Pixel Grouping (PPG) interpolation.
.TP
.B -q 3
Use Adaptive Homogeneity-Directed (AHD) interpolation.
.TP
.B -f
Interpolate RGB as four colors. Use this if the output shows
false 2x2 meshes with VNG or mazes with AHD.
.TP
.B -m number_of_passes
After interpolation, clean up color artifacts by repeatedly
applying a 3x3 median filter to the R-G and B-G channels.
.SH OUTPUT OPTIONS
By default,
.B dcraw
writes PGM/PPM/PAM with 8-bit samples, a BT.709 gamma curve,
a histogram-based white level, and no metadata.
.TP
.B -W
Use a fixed white level, ignoring the image histogram.
.TP
.B -b brightness
Divide the white level by this number, 1.0 by default.
.TP
.B -g power toe_slope
Set the gamma curve, by default BT.709
.RB ( -g\ 2.222\ 4.5 ).
If you prefer sRGB gamma, use
.BR -g\ 2.4\ 12.92 .
For a simple power curve, set the toe slope to zero.
.TP
.B -6
Write sixteen bits per sample instead of eight.
.TP
.B -4
Linear 16-bit, same as
.BR -6\ -W\ -g\ 1\ 1 .
.TP
.B -T
Write TIFF with metadata instead of PGM/PPM/PAM.
.TP
.B -t [0-7,90,180,270]
Flip the output image. By default,
.B dcraw
applies the flip specified by the camera.
.B -t 0
disables all flipping.
.TP
.B -j
For Fuji\ Super\ CCD cameras, show the image tilted 45 degrees.
For cameras with non-square pixels, do not stretch the image to
its correct aspect ratio. In any case, this option guarantees
that each output pixel corresponds to one raw pixel.
.TP
.BR "-s [0..N-1]" " or " "-s all"
If a file contains N raw images, choose one or "all" to decode.
For example, Fuji\ Super\ CCD\ SR cameras generate a second image
underexposed four stops to show detail in the highlights.
.SH FILES
.TP
\:./.badpixels, ../.badpixels, ../../.badpixels, ...
List of your camera's dead pixels, so that
.B dcraw
can interpolate around them. Each line specifies the column,
row, and UNIX time of death for one pixel. For example:
.sp 1
.nf
962 91 1028350000 # died between August 1 and 4, 2002
1285 1067 0 # don't know when this pixel died
.fi
.sp 1
These coordinates are before any cropping or rotation, so use
.B dcraw -j -t 0
to locate dead pixels.
.SH "SEE ALSO"
.BR pgm (5),
.BR ppm (5),
.BR pam (5),
.BR pamsumm (1),
.BR pnmgamma (1),
.BR pnmtotiff (1),
.BR pnmtopng (1),
.BR gphoto2 (1),
.BR cjpeg (1),
.BR djpeg (1)
.SH AUTHOR
Written by David Coffin, dcoffin a cybercom o net

10
dcraw.1.patch Normal file
View File

@ -0,0 +1,10 @@
--- dcraw.1.orig 2009-05-14 23:06:03.000000000 +0300
+++ dcraw.1 2011-03-21 22:00:59.283000022 +0200
@@ -10,7 +10,6 @@
.\" http://www.cybercom.net/~dcoffin
.\"
.TH dcraw 1 "May 14, 2009"
-.LO 1
.SH NAME
dcraw - command-line decoder for raw digital photos
.SH SYNOPSIS

8784
dcraw.c

File diff suppressed because it is too large Load Diff

View File

@ -1,3 +1,40 @@
-------------------------------------------------------------------
Wed Mar 23 19:09:55 UTC 2011 - asterios.dramis@gmail.com
- updated to version 9.06
* Support the Nikon D3100 & D7000 & P7000, Panasonic FZ40 & FZ100 & LX5,
Samsung WB2000, Nokia X2, Canon SX120 & PowerShot G12, Hasselblad H4D,
Pentax 645D & K-5 & K-r, Sony SLT-A33 & SLT-A55V, Canon SX20 IS, Samsung
EX1, Sony A450, Kodak Z981, Olympus E-P2, Panasonic G2 & GF1, Samsung WB550
and NX10, Casio EX-Z1050, Fuji HS10, Canon EOS 550D / Digital Rebel T2i /
Kiss Digital X4.
* Support high-ISO images from the Samsung WB2000.
* Read correct camera WB from Nikon NRW and Samsung SRW files.
* Copied color matrices from Adobe DNG Converter 6.3.
* Fixed rotation for Kodak EasyShare and some Canon EOS photos.
* Get Fuji HS10 black level from the metadata.
* Built color matrices for the Sony NEX-3 and NEX-5.
* Support A100 images modified by Sony software.
* Split the darkness level into four separate color channels.
- Replaced dcraw.c and dcraw.1 with the package tarball provided from the official
site.
- Added clean_crw and fuji_green programs.
- Added rawphoto.c file in the documentation (gimp-plugin).
- Removed dcwrap program (no longer provided from the official site).
- Spec file updates:
* Changed version numbering scheme (used the one from the tarball provided).
* Changes based on rpmdevtools templates and spec-cleaner run.
* Added description for dcraw-omp.patch based on openSUSE Patches Guidelines.
* Added gettext-runtime in BuildRequires:.
* Added dcraw-lang package.
* Compile also fujiturn16 program (to rotate 48-bit PPM images).
* Updates in %prep, %build, %install and %files sections based also on Fedora
and Debian packages.
- Rebased dcraw-omp.patch to apply cleanly.
- Added a patch for dcraw.1 to fix "macro `LO' not defined" rpm post build
check warning.
- Added a patch for fuji_green.c to fix gcc implicit declaration warning.
-------------------------------------------------------------------
Sun May 2 00:56:47 CEST 2010 - postadal@suse.cz

View File

@ -1,7 +1,7 @@
#
# spec file for package dcraw (Version 1.432)
# spec file for package dcraw
#
# Copyright (c) 2010 SUSE LINUX Products GmbH, Nuernberg, Germany.
# Copyright (c) 2011 SUSE LINUX Products GmbH, Nuernberg, Germany.
#
# All modifications and additions to the file contributed by third parties
# remain the property of their copyright owners, unless otherwise agreed
@ -19,72 +19,151 @@
Name: dcraw
BuildRequires: libjpeg-devel liblcms-devel
Version: 1.432
Version: 9.06
Release: 1
License: PERMISSIVE-OSI-COMPLIANT
Group: Productivity/Graphics/Convertors
Url: http://www.cybercom.net/~dcoffin/dcraw/
Summary: Raw Digital Photo Decoding
# NOTE: call "sh update_dcraw" to update to latest version.
Source: http://www.cybercom.net/~dcoffin/dcraw/dcraw.c
Source1: http://www.cybercom.net/~dcoffin/dcraw/dcraw.1
Source2: README
Source3: README.SuSE
Source4: badpixels
Source5: http://www.cybercom.net/~dcoffin/dcraw/dcwrap
Source7: http://www.cybercom.net/~dcoffin/dcraw/fujiturn.c
Source8: http://www.cybercom.net/~dcoffin/dcraw/parse.c
Source9: update_dcraw
Patch: dcraw-omp.patch
AutoReqProv: on
License: PERMISSIVE-OSI-COMPLIANT
Url: http://www.cybercom.net/~dcoffin/dcraw/
Group: Productivity/Graphics/Convertors
# http://www.cybercom.net/~dcoffin/dcraw/archive/dcraw-9.06.tar.gz
Source0: %{name}-%{version}.tar.bz2
#*** NOTE: run "sh update_dcraw" to update to latest version of the following sources. wget, rcs and lynx are required for the update.
Source1: README
# http://www.cybercom.net/~dcoffin/dcraw/.badpixels
Source2: badpixels
Source3: http://www.cybercom.net/~dcoffin/dcraw/clean_crw.c
Source4: http://www.cybercom.net/~dcoffin/dcraw/fuji_green.c
Source5: http://www.cybercom.net/~dcoffin/dcraw/fujiturn.c
Source6: http://www.cybercom.net/~dcoffin/dcraw/parse.c
Source7: http://www.cybercom.net/~dcoffin/dcraw/rawphoto.c
#***
Source100: README.SuSE
Source101: update_dcraw
# PATCH-FEATURE-OPENSUSE dcraw-omp.patch postadal@suse.cz -- Speed up decoding (-fomp disabled by default)
Patch0: dcraw-omp.patch
# PATCH-FIX-OPENSUSE dcraw.1.patch asterios.dramis@gmail.com -- Fix "macro `LO' not defined" rpm post build check warning
Patch1: dcraw.1.patch
# PATCH-FIX-OPENSUSE fuji_green.c_fix_gcc_warnings.patch asterios.dramis@gmail.com - Fix gcc implicit declaration warning
Patch2: fuji_green.c_fix_gcc_warnings.patch
BuildRoot: %{_tmppath}/%{name}-%{version}-build
BuildRequires: gettext-runtime
BuildRequires: libjpeg-devel
BuildRequires: liblcms-devel
Recommends: %{name}-lang = %{version}
%description
Command line tools for raw digital photo decoding and processing.
Authors:
--------
Dave Coffin
%lang_package
%prep
%setup -q -n . -D -T 0
cp -a %SOURCE0 %SOURCE1 %SOURCE2 %SOURCE3 %SOURCE4 %SOURCE5 %SOURCE7 %SOURCE8 .
%patch
mv badpixels .badpixels
%setup -q -n %{name}
cp -a %SOURCE3 %SOURCE4 %SOURCE5 %SOURCE6 .
%patch0
%patch1
%patch2
%build
export CFLAGS="$RPM_OPT_FLAGS -fno-strict-aliasing"
%if %suse_version > 1000
export CFLAGS="$CFLAGS -fstack-protector-all"
%endif
for file in *.c ; do
LDFLAGS=
if test $file = dcraw.c ; then
LDFLAGS="-lm -ljpeg -llcms"
# gcc $CFLAGS -fopenmp -o ${file%.c}-omp $file $LDFLAGS
fi
gcc $CFLAGS -o ${file%.c} $file $LDFLAGS
done
export CFLAGS="%{optflags} -fno-strict-aliasing -fstack-protector-all"
for file in *.c ; do
LDFLAGS=
OTHERFLAGS=
if test $file = dcraw.c ; then
LDFLAGS="-lm -ljpeg -llcms -DLOCALEDIR=\""%{_datadir}/locale"\""
# gcc $CFLAGS -fopenmp -o ${file%.c}-omp $file $LDFLAGS
fi
if test $file = fuji_green.c ; then
LDFLAGS="-lm"
fi
gcc $CFLAGS $OTHERFLAGS -o ${file%.c} $file $LDFLAGS
done
# Compile with -D_16BIT to rotate 48-bit PPM images
gcc $CFLAGS -D_16BIT -o fujiturn16 fujiturn.c
# Build language catalogs
for catsrc in dcraw_*.po ; do
lang="${catsrc%.po}"
lang="${lang#dcraw_}"
msgfmt -o "dcraw_${lang}.mo" "$catsrc"
done
%install
mkdir -p $RPM_BUILD_ROOT/%_bindir
mkdir -p $RPM_BUILD_ROOT%_mandir/man1
install -m 0755 dcraw $RPM_BUILD_ROOT/%_bindir/
# install -m 0755 dcraw-omp $RPM_BUILD_ROOT/%_bindir/
install -m 0644 dcraw.1 $RPM_BUILD_ROOT/%_mandir/man1/
install -m 0755 parse $RPM_BUILD_ROOT/%_bindir/dcparse
install -m 0755 fujiturn $RPM_BUILD_ROOT/%_bindir/
install -d -m 0755 %{buildroot}%{_bindir}
install -d -m 0755 %{buildroot}%{_mandir}/man1
install -pm 0755 dcraw %{buildroot}%{_bindir}/
#install -pm 0755 dcraw-omp %{buildroot}%{_bindir}/
install -pm 0644 dcraw.1 %{buildroot}%{_mandir}/man1/
install -pm 0755 clean_crw %{buildroot}%{_bindir}/
install -pm 0755 fuji_green %{buildroot}%{_bindir}/
install -pm 0755 fujiturn %{buildroot}%{_bindir}/
install -pm 0755 fujiturn16 %{buildroot}%{_bindir}/
install -pm 0755 parse %{buildroot}%{_bindir}/dcparse
# Install language catalogs
for catalog in dcraw_*.mo ; do
lang="${catalog%.mo}"
lang="${lang#dcraw_}"
install -d -m 0755 "%{buildroot}%{_datadir}/locale/${lang}/LC_MESSAGES"
install -pm 0644 "$catalog" "%{buildroot}%{_datadir}/locale/${lang}/LC_MESSAGES/dcraw.mo"
done
# Install localized manpages
for manpage in dcraw_*.1 ; do
lang="${manpage%.1}"
lang="${lang#dcraw_}"
install -d -m 0755 "%{buildroot}%{_mandir}/${lang}/man1"
install -pm 0644 "${manpage}" "%{buildroot}%{_mandir}/${lang}/man1/dcraw.1"
done
# Documentation
cp -a %SOURCE1 %SOURCE2 %SOURCE7 %SOURCE100 .
mv badpixels .badpixels
%find_lang %{name} --with-man
%clean
rm -rf $RPM_BUILD_ROOT
rm -rf %{buildroot}
%files
%defattr(-,root,root)
%doc README README.SuSE .badpixels dcwrap
%_bindir/*
%doc %_mandir/man*/*
%defattr(-,root,root,-)
%doc .badpixels README README.SuSE rawphoto.c
%{_bindir}/clean_crw
%{_bindir}/dcparse
%{_bindir}/dcraw
%{_bindir}/fuji_green
%{_bindir}/fujiturn
%{_bindir}/fujiturn16
%doc %{_mandir}/man1/dcraw.1%{ext_man}
%files lang -f %{name}.lang
%defattr(-,root,root,-)
%dir %{_mandir}/ca
%dir %{_mandir}/ca/man1
%dir %{_mandir}/cs
%dir %{_mandir}/cs/man1
%dir %{_mandir}/da
%dir %{_mandir}/da/man1
%dir %{_mandir}/eo
%dir %{_mandir}/eo/man1
%dir %{_mandir}/hu
%dir %{_mandir}/hu/man1
%dir %{_mandir}/pl
%dir %{_mandir}/pl/man1
%dir %{_mandir}/pt
%dir %{_mandir}/pt/man1
%if 0%{?suse_version} < 1130
%dir %{_mandir}/ru
%dir %{_mandir}/ru/man1
%endif
%dir %{_mandir}/sv
%dir %{_mandir}/sv/man1
%dir %{_mandir}/zh_CN
%dir %{_mandir}/zh_CN/man1
%dir %{_mandir}/zh_TW
%dir %{_mandir}/zh_TW/man1
%changelog

27
dcwrap
View File

@ -1,27 +0,0 @@
#!/bin/sh
# Rough equivalents to XV's Sharpen algorithm
cat > sharpen50.pgm << xx
P2 3 3 18
8 8 8 8 26 8 8 8 8
xx
cat > sharpen66.pgm << xx
P2 3 3 18
7 7 7 7 34 7 7 7 7
xx
cat > sharpen75.pgm << xx
P2 3 3 6
2 2 2 2 14 2 2 2 2
xx
cat > sharpen90.pgm << xx
P2 3 3 2
0 0 0 0 10 0 0 0 0
xx
for x in `ls *.crw | cut -d. -f1`
do
dcraw -f -c $x.crw | pnmconvol sharpen66.pgm \
| cjpeg -quality 90 > $x.jpeg
touch -r $x.crw $x.jpeg
done

375
fuji_green.c Normal file
View File

@ -0,0 +1,375 @@
/*
fuji_green -- read Fuji green pixels
$Revision: 1.2 $
$Date: 2006/03/01 01:46:47 $
*/
#include <ctype.h>
#include <math.h>
#include <setjmp.h>
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
#define ushort UshORt
typedef unsigned char uchar;
typedef unsigned short ushort;
FILE *ifp;
short order;
char *ifname, make[64], model[64];
int data_offset, raw_height, raw_width, height, width;
int fuji_layout, fuji_secondary, use_secondary=0, verbose=0;
ushort *image;
void (*load_raw)();
float bright=1.0;
void write_ppm(FILE *);
void (*write_fun)(FILE *) = write_ppm;
jmp_buf failure;
#define CLASS
void CLASS merror (void *ptr, char *where)
{
if (ptr) return;
fprintf (stderr, "%s: Out of memory in %s\n", ifname, where);
longjmp (failure, 1);
}
ushort CLASS get2()
{
uchar a, b;
a = fgetc(ifp);
b = fgetc(ifp);
if (order == 0x4949) /* "II" means little-endian */
return a + (b << 8);
else /* "MM" means big-endian */
return (a << 8) + b;
}
int CLASS get4()
{
uchar a, b, c, d;
a = fgetc(ifp);
b = fgetc(ifp);
c = fgetc(ifp);
d = fgetc(ifp);
if (order == 0x4949)
return a + (b << 8) + (c << 16) + (d << 24);
else
return (a << 24) + (b << 16) + (c << 8) + d;
}
/*
Faster than calling get2() multiple times.
*/
void CLASS read_shorts (ushort *pixel, int count)
{
fread (pixel, 2, count, ifp);
if ((order == 0x4949) == (ntohs(0x1234) == 0x1234))
swab (pixel, pixel, count*2);
}
void CLASS fuji_load_raw()
{
ushort *pixel, *img;
int row, col;
pixel = calloc (raw_width, 2);
merror (pixel, "fuji_load_raw()");
for (row=0; row < height; row++)
if (fuji_layout) {
read_shorts (image+row*width, width);
fseek (ifp, (raw_width*2 - width)*2, SEEK_CUR);
} else {
read_shorts (pixel, raw_width);
for (img=image+row*width, col=0; col < width; col++)
img[col] = pixel[col*2+1];
}
free (pixel);
}
void CLASS parse_fuji (int offset)
{
unsigned entries, tag, len, save;
fseek (ifp, offset, SEEK_SET);
entries = get4();
if (entries > 255) return;
while (entries--) {
tag = get2();
len = get2();
save = ftell(ifp);
if (tag == 0x100) {
raw_height = get2();
raw_width = get2();
} else if (tag == 0x121) {
height = get2();
width = get2();
} else if (tag == 0x130)
fuji_layout = fgetc(ifp) >> 7;
fseek (ifp, save+len, SEEK_SET);
}
if (fuji_layout) {
height *= 2;
width /= 2;
}
}
void CLASS parse_tiff (int base)
{
int doff, entries, tag, type, len, save;
fseek (ifp, base, SEEK_SET);
order = get2();
get2(); /* Should be 42 for standard TIFF */
while ((doff = get4())) {
fseek (ifp, doff+base, SEEK_SET);
entries = get2();
while (entries--) {
tag = get2();
type = get2();
len = get4();
save = ftell(ifp)+4;
fseek (ifp, base+get4(), SEEK_SET);
switch (tag) {
case 0x10f: /* Make tag */
fgets (make, 64, ifp);
break;
case 0x110: /* Model tag */
fgets (model, 64, ifp);
}
fseek (ifp, save, SEEK_SET);
}
}
}
int CLASS identify()
{
char head[32], *c;
int thumb_offset;
make[0] = model[0] = 0;
data_offset = raw_height = raw_width = height = width = 0;
fuji_secondary = 0;
order = 0x4d4d;
fread (head, 1, 32, ifp);
if (memcmp (head, "FUJIFILM", 8)) return 1;
fseek (ifp, 84, SEEK_SET);
thumb_offset = get4();
fseek (ifp, 92, SEEK_SET);
parse_fuji (get4());
if (thumb_offset > 120) {
fseek (ifp, 120, SEEK_SET);
fuji_secondary = get4() && 1;
}
fseek (ifp, 100, SEEK_SET);
data_offset = get4();
parse_tiff (thumb_offset+12);
c = model + strlen(model); /* Remove trailing spaces */
while (*--c == ' ') *c = 0;
if (!strcmp(model,"FinePix S5100") ||
!strcmp(model,"FinePix S5500")) return 1;
load_raw = fuji_load_raw;
if (!strcmp(model+7,"S2Pro")) {
strcpy (model+7," S2Pro");
height = 2144;
width = 2880;
}
data_offset += (raw_height - height + 1)*raw_width - width;
if (fuji_secondary)
data_offset += use_secondary * ( strcmp(model+7," S3Pro")
? (raw_width *= 2) : raw_height*raw_width*2 );
data_offset += fuji_layout*raw_width*2;
width >>= !fuji_layout;
height >>= fuji_layout;
fseek (ifp, data_offset, SEEK_SET);
return 0;
}
void CLASS write_ppm (FILE *ofp)
{
int i, size, val, total, histogram[0x2000];
float white, r;
uchar lut[0x10000];
memset (histogram, 0, sizeof histogram);
size = width * height;
for (i = 0; i < size; i++)
histogram[image[i] >> 4]++;
i = size * 0.01; /* 99th percentile white point */
for (val=0x2000, total=0; --val; )
if ((total += histogram[val]) > i) break;
white = (val << 4) / bright;
for (i=0; i < 0x10000; i++) {
r = i / white;
val = (r <= 0.018 ? r*4.5 : pow(r,0.45)*1.099-0.099) * 256;
if (val > 255) val = 255;
lut[i] = val;
}
fprintf (ofp, "P5\n%d %d\n255\n", width, height);
for (i=0; i < size; i++)
fputc (lut[image[i]], ofp);
}
void CLASS write_raw16 (FILE *ofp)
{
if (ntohs(0x1234) != 0x1234)
swab (image, image, width*height*2);
fwrite (image, width*height, 2, ofp);
}
void CLASS write_ppm16 (FILE *ofp)
{
fprintf (ofp, "P5\n%d %d\n%d\n", width, height, 65535);
write_raw16 (ofp);
}
void CLASS write_psd (FILE *ofp)
{
char head[] = {
'8','B','P','S', /* signature */
0,1,0,0,0,0,0,0, /* version and reserved */
0,1, /* number of channels */
0,0,0,0, /* height, big-endian */
0,0,0,0, /* width, big-endian */
0,16, /* 16-bit color */
0,1, /* mode (1=grey, 3=rgb) */
0,0,0,0, /* color mode data */
0,0,0,0, /* image resources */
0,0,0,0, /* layer/mask info */
0,0 }; /* no compression */
int hw[2];
hw[0] = htonl(height*2); /* write the header */
hw[1] = htonl(width*2);
memcpy (head+14, hw, sizeof hw);
fwrite (head, 40, 1, ofp);
write_raw16 (ofp);
}
int CLASS main (int argc, char **argv)
{
int arg, status=0;
int identify_only=0, write_to_stdout=0;
char opt, *ofname, *cp;
const char *write_ext = ".pgm";
FILE *ofp = stdout;
if (argc == 1) {
fprintf (stderr,
"\nFuji Green channel output"
"\nby Dave Coffin, dcoffin a cybercom o net"
"\n\nUsage: %s [options] file1 file2 ...\n"
"\nValid options:"
"\n-v Print verbose messages"
"\n-c Write image data to standard output"
"\n-i Identify files without decoding them"
"\n-s Use secondary pixels if available"
"\n-b <num> Set brightness (default = 1.0)"
"\n-2 Write 8-bit non-linear PGM (default)"
"\n-4 Write 16-bit linear PGM"
"\n-3 Write 16-bit linear PSD (Adobe Photoshop)"
"\n\n", argv[0]);
return 1;
}
argv[argc] = "";
for (arg=1; argv[arg][0] == '-'; ) {
opt = argv[arg++][1];
if (strchr ("b", opt) && !isdigit(argv[arg][0])) {
fprintf (stderr, "\"-%c\" requires a numeric argument.\n", opt);
return 1;
}
switch (opt) {
case 'v': verbose = 1; break;
case 'i': identify_only = 1; break;
case 'c': write_to_stdout = 1; break;
case 's': use_secondary = 1; break;
case 'b': bright = atof(argv[arg++]); break;
case '2': write_fun = write_ppm; break;
case '4': write_fun = write_ppm16; break;
case '3': write_fun = write_psd; write_ext = ".psd"; break;
default:
fprintf (stderr, "Unknown option \"-%c\".\n", opt);
return 1;
}
}
if (arg == argc) {
fprintf (stderr, "No files to process.\n");
return 1;
}
if (write_to_stdout) {
if (isatty(1)) {
fprintf (stderr, "Will not write an image to the terminal!\n");
return 1;
}
#if defined(WIN32) || defined(DJGPP)
if (setmode(1,O_BINARY) < 0) {
perror("setmode()");
return 1;
}
#endif
}
for ( ; arg < argc; arg++) {
status = 1;
image = NULL;
if (setjmp (failure)) {
if (fileno(ifp) > 2) fclose (ifp);
if (fileno(ofp) > 2) fclose (ofp);
if (image) free (image);
status = 1;
continue;
}
ifname = argv[arg];
if (!(ifp = fopen (ifname, "rb"))) {
perror (ifname);
continue;
}
if ((status = identify())) {
fprintf (stderr, "%s: unsupported file format.\n", ifname);
fclose (ifp);
continue;
}
if (identify_only) {
fprintf (stderr, "%s is a %s %s image.\n", ifname, make, model);
fclose (ifp);
continue;
}
image = calloc (height * width, sizeof *image);
merror (image, "main()");
if (verbose)
fprintf (stderr,
"Loading %s %s image from %s...\n", make, model, ifname);
(*load_raw)();
fclose (ifp);
ofname = malloc (strlen(ifname) + 16);
merror (ofname, "main()");
if (write_to_stdout)
strcpy (ofname, "standard output");
else {
strcpy (ofname, ifname);
if ((cp = strrchr (ofname, '.'))) *cp = 0;
strcat (ofname, write_ext);
ofp = fopen (ofname, "wb");
if (!ofp) {
status = 1;
perror (ofname);
goto cleanup;
}
}
if (verbose)
fprintf (stderr, "Writing data to %s...\n", ofname);
(*write_fun)(ofp);
if (ofp != stdout)
fclose (ofp);
cleanup:
free (ofname);
free (image);
}
return status;
}

View File

@ -0,0 +1,11 @@
--- fuji_green.c.orig 2006-03-01 03:46:47.000000000 +0200
+++ fuji_green.c 2011-03-22 21:26:43.871000023 +0200
@@ -11,6 +11,8 @@
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
+#include <unistd.h>
+#include <netinet/in.h>
#define ushort UshORt
typedef unsigned char uchar;

102
parse.c
View File

@ -1,12 +1,12 @@
/*
Raw Photo Parser
Copyright 2004-2006 by Dave Coffin, dcoffin a cybercom o net
Copyright 2004-2010 by Dave Coffin, dcoffin a cybercom o net
This program displays raw metadata for all raw photo formats.
It is free for all uses.
$Revision: 1.69 $
$Date: 2009/08/28 22:52:20 $
$Revision: 1.72 $
$Date: 2010/12/17 03:16:26 $
*/
#include <stdio.h>
@ -235,12 +235,15 @@ void parse_makernote (int base, int level)
fseek (ifp, -2, SEEK_CUR);
else if (!strcmp (buf,"AOC"))
fseek (ifp, -4, SEEK_CUR);
else
else {
fseek (ifp, -10, SEEK_CUR);
if (!strncmp(make,"SAMSUNG",7))
base = ftell(ifp);
}
entries = get2();
if (entries > 127) return;
puts(" MakerNote:");
printf ("%*sMakerNote:\n", level*2-2, "");
while (entries--) {
save = ftell(ifp);
tag = get2();
@ -285,7 +288,7 @@ void parse_exif (int base, int level)
{
int entries, tag, type, count, save;
puts("EXIF table:");
printf ("%*sEXIF table:\n", level*2-2, "");
entries = get2();
while (entries--) {
save = ftell(ifp);
@ -300,6 +303,20 @@ void parse_exif (int base, int level)
}
void parse_mos(int level);
void parse_minolta (int base);
void parse_tiff (int base, int level);
void parse_thumb (int base, int level)
{
int i=order;
order = 0x4d4d;
fseek (ifp, base, SEEK_SET);
if (get4()==0xffd8ffe1 && get2() && get4()==0x45786966 && !get2()) {
printf ("%*sEmbedded JPEG:\n", level*2, "");
parse_tiff (ftell(ifp), level+1);
}
order = i;
}
void sony_decrypt (unsigned *data, int len, int start, int key)
{
@ -334,17 +351,18 @@ int parse_tiff_ifd (int base, int level)
slen = count;
if (slen > 128) slen = 128;
tiff_dump (base, tag, type, count, level);
if (type == 13) tag = 0x14a;
switch (tag) {
case 0x10f: /* Make tag */
case 271: /* Make tag */
fgets (make, slen, ifp);
break;
case 0x110: /* Model tag */
case 272: /* Model tag */
fgets (model, slen, ifp);
break;
case 33405: /* Model2 tag */
fgets (model2, slen, ifp);
break;
case 0x14a: /* SubIFD tag */
case 330: /* SubIFD tag */
save2 = ftell(ifp);
for (i=0; i < count; i++) {
printf ("SubIFD #%d:\n", i+1);
@ -353,9 +371,19 @@ int parse_tiff_ifd (int base, int level)
parse_tiff_ifd (base, level+1);
}
break;
case 273: /* StripOffset */
case 513: /* JpegIFOffset */
case 61447:
fseek (ifp, get4()+base, SEEK_SET);
case 46:
parse_thumb (ftell(ifp), level);
break;
case 29184: sony_offset = get4(); break;
case 29185: sony_length = get4(); break;
case 29217: sony_key = get4(); break;
case 29264:
parse_minolta (ftell(ifp));
break;
case 33424:
case 65024:
puts("Kodak private data:");
@ -379,16 +407,16 @@ int parse_tiff_ifd (int base, int level)
save2 = ftell(ifp);
order = get2();
fseek (ifp, save2 + (get2(),get4()), SEEK_SET);
parse_tiff_ifd (save2, level+1);
parse_tiff_ifd (save2, level+1);
order = i;
break;
case 50706:
is_dng = 1;
break;
case 50740:
if (count != 4 || type != 1) break;
puts("Sony SR2 private IFD:");
fseek (ifp, get4()+base, SEEK_SET);
if (is_dng) break;
parse_minolta (i = get4()+base);
fseek (ifp, i, SEEK_SET);
parse_tiff_ifd (base, level+1);
}
fseek (ifp, save+12, SEEK_SET);
@ -414,7 +442,7 @@ int parse_tiff_ifd (int base, int level)
/*
Parse a TIFF file looking for camera model and decompress offsets.
*/
void parse_tiff (int base)
void parse_tiff (int base, int level)
{
int doff, ifd=0;
@ -424,25 +452,31 @@ void parse_tiff (int base)
get2();
while ((doff = get4())) {
fseek (ifp, doff+base, SEEK_SET);
printf ("IFD #%d:\n", ifd++);
if (parse_tiff_ifd (base, 0)) break;
printf ("%*sIFD #%d:\n", level*2, "", ifd++);
if (parse_tiff_ifd (base, level)) break;
}
}
void parse_minolta()
void parse_minolta (int base)
{
int data_offset, save, tag, len;
unsigned offset, save, len, j;
char tag[4];
fseek (ifp, 4, SEEK_SET);
data_offset = get4() + 8;
while ((save=ftell(ifp)) < data_offset) {
tag = get4();
fseek (ifp, base, SEEK_SET);
if (fgetc(ifp) || fgetc(ifp)-'M' || fgetc(ifp)-'R') return;
order = fgetc(ifp) * 0x101;
offset = base + get4() + 8;
while ((save=ftell(ifp)) < offset) {
fread (tag, 1, 4, ifp);
len = get4();
printf ("Tag %c%c%c offset %06x length %06x\n",
tag>>16, tag>>8, tag, save, len);
switch (tag) {
case 0x545457: /* TTW */
parse_tiff (ftell(ifp));
printf ("Minolta tag %3.3s offset %06x length %06x", tag+1, save, len);
if (!strncmp (tag+1,"TTW",3)) {
putchar ('\n');
parse_tiff (ftell(ifp),0);
} else {
for (j = 0; j < len/2 && j < 128; j++)
printf ("%c%04x",(j & 15) || len < 9 ? ' ':'\n', get2());
putchar ('\n');
}
fseek (ifp, save+len+8, SEEK_SET);
}
@ -542,7 +576,7 @@ int parse_jpeg (int offset)
hlen = get4();
if (get4() == 0x48454150) /* "HEAP" */
parse_ciff (save+hlen, len-hlen, 0);
parse_tiff (save+6);
parse_tiff (save+6,0);
fseek (ifp, save+len, SEEK_SET);
}
return 1;
@ -957,24 +991,26 @@ void identify()
if ((cp = memmem (head, 32, "MMMM", 4)) ||
(cp = memmem (head, 32, "IIII", 4))) {
parse_phase_one (cp-head);
if (cp-head) parse_tiff (0);
if (cp-head) parse_tiff (0,0);
} else if (order == 0x4949 || order == 0x4d4d) {
if (!memcmp(head+6,"HEAPCCDR",8)) {
parse_ciff (hlen, fsize - hlen, 0);
fseek (ifp, hlen, SEEK_SET);
} else
parse_tiff (0);
parse_tiff (0,0);
} else if (!memcmp (head,"NDF0",4)) {
parse_tiff (12);
parse_tiff (12,0);
} else if (!memcmp (head,"\0MRM",4)) {
parse_minolta();
parse_minolta (0);
} else if (!memcmp (head,"FUJIFILM",8)) {
fseek (ifp, 84, SEEK_SET);
toff = get4();
tlen = get4();
parse_fuji (92);
if (toff > 120) parse_fuji (120);
parse_tiff (toff+12);
fseek (ifp, 100, SEEK_SET);
parse_tiff (get4(),0);
parse_thumb (toff,0);
} else if (!memcmp (head,"RIFF",4)) {
fseek (ifp, 0, SEEK_SET);
parse_riff(0);

355
rawphoto.c Normal file
View File

@ -0,0 +1,355 @@
/*
Raw photo loader plugin for The GIMP
by Dave Coffin at cybercom dot net, user dcoffin
http://www.cybercom.net/~dcoffin/
$Revision: 1.32 $
$Date: 2008/09/16 05:41:39 $
This code is licensed under the same terms as The GIMP.
To simplify maintenance, it calls my command-line "dcraw"
program to do the actual decoding.
To install locally:
gimptool --install rawphoto.c
To install globally:
gimptool --install-admin rawphoto.c
To build without installing:
gcc -o rawphoto rawphoto.c `gtk-config --cflags --libs` -lgimp -lgimpui
*/
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
#include <gtk/gtk.h>
#include <libgimp/gimp.h>
#include <libgimp/gimpui.h>
#if GIMP_CHECK_VERSION(1,3,2)
#define GimpRunModeType GimpRunMode
#endif
#if GIMP_CHECK_VERSION(1,3,17)
#define RAWPHOTO_CONST const
#else
#define RAWPHOTO_CONST
#endif
#include <locale.h>
#include <libintl.h>
#define _(String) gettext(String)
#define PLUG_IN_VERSION "1.1.20 - 16 September 2008"
static void query(void);
static void run(RAWPHOTO_CONST gchar *name,
gint nparams,
RAWPHOTO_CONST GimpParam *param,
gint *nreturn_vals,
GimpParam **return_vals);
static gint load_dialog (gchar *name);
static gint32 load_image (gchar *filename);
GimpPlugInInfo PLUG_IN_INFO =
{
NULL, /* init_procedure */
NULL, /* quit_procedure */
query, /* query_procedure */
run, /* run_procedure */
};
static struct {
gboolean check_val[6];
gfloat spin_val[2];
} cfg = {
{ FALSE, FALSE, FALSE, FALSE, FALSE, FALSE },
{ 1, 0 }
};
MAIN ()
static void query (void)
{
static GimpParamDef load_args[] =
{
{ GIMP_PDB_INT32, "run_mode", "Interactive, non-interactive" },
{ GIMP_PDB_STRING, "filename", "The name of the file to load" },
{ GIMP_PDB_STRING, "raw_filename", "The name of the file to load" },
};
static GimpParamDef load_return_vals[] =
{
{ GIMP_PDB_IMAGE, "image", "Output image" },
};
static gint num_load_args =
sizeof load_args / sizeof load_args[0];
static gint num_load_return_vals =
sizeof load_return_vals / sizeof load_return_vals[0];
gimp_install_procedure ("file_rawphoto_load",
"Loads raw digital camera files",
"This plug-in loads raw digital camera files.",
"Dave Coffin at cybercom dot net, user dcoffin",
"Copyright 2003-2008 by Dave Coffin",
PLUG_IN_VERSION,
"<Load>/rawphoto",
NULL,
GIMP_PLUGIN,
num_load_args,
num_load_return_vals,
load_args,
load_return_vals);
gimp_register_load_handler ("file_rawphoto_load",
"3fr,arw,bay,bmq,cine,cr2,crw,cs1,dc2,dcr,dng,erf,fff,hdr,ia,jpg,k25,kc2,kdc,mdc,mef,mos,mrw,nef,nrw,orf,pef,pxn,qtk,raf,raw,rdc,rw2,sr2,srf,sti,tif,x3f", "");
}
static void run (RAWPHOTO_CONST gchar *name,
gint nparams,
RAWPHOTO_CONST GimpParam *param,
gint *nreturn_vals,
GimpParam **return_vals)
{
static GimpParam values[2];
GimpRunModeType run_mode;
GimpPDBStatusType status;
gint32 image_id = -1;
gchar *command, *fname;
int stat;
*nreturn_vals = 1;
*return_vals = values;
status = GIMP_PDB_CALLING_ERROR;
if (strcmp (name, "file_rawphoto_load")) goto done;
status = GIMP_PDB_EXECUTION_ERROR;
fname = param[1].data.d_string;
command = g_malloc (strlen(fname)+20);
if (!command) goto done;
/*
Is the file really a raw photo? If not, try loading it
as a regular JPEG or TIFF.
*/
sprintf (command, "dcraw -i '%s'\n",fname);
fputs (command, stderr);
stat = system (command);
g_free (command);
if (stat) {
if (stat > 0x200)
g_message (_("The \"rawphoto\" plugin won't work because "
"there is no \"dcraw\" executable in your path."));
if (!strcasecmp (fname + strlen(fname) - 4, ".jpg"))
*return_vals = gimp_run_procedure2
("file_jpeg_load", nreturn_vals, nparams, param);
else
*return_vals = gimp_run_procedure2
("file_tiff_load", nreturn_vals, nparams, param);
return;
}
gimp_get_data ("plug_in_rawphoto", &cfg);
status = GIMP_PDB_CANCEL;
run_mode = param[0].data.d_int32;
if (run_mode == GIMP_RUN_INTERACTIVE)
if (!load_dialog (param[1].data.d_string)) goto done;
status = GIMP_PDB_EXECUTION_ERROR;
image_id = load_image (param[1].data.d_string);
if (image_id == -1) goto done;
*nreturn_vals = 2;
values[1].type = GIMP_PDB_IMAGE;
values[1].data.d_image = image_id;
status = GIMP_PDB_SUCCESS;
gimp_set_data ("plug_in_rawphoto", &cfg, sizeof cfg);
done:
values[0].type = GIMP_PDB_STATUS;
values[0].data.d_status = status;
}
static gint32 load_image (gchar *filename)
{
int tile_height, depth, width, height, row, nrows;
FILE *pfp;
gint32 image, layer;
GimpDrawable *drawable;
GimpPixelRgn pixel_region;
guchar *pixel;
char *command, nl;
setlocale (LC_NUMERIC, "C");
command = g_malloc (strlen(filename)+100);
if (!command) return -1;
sprintf (command,
"dcraw -c%s%s%s%s%s%s -b %0.2f -H %d '%s'\n",
cfg.check_val[0] ? " -q 0":"",
cfg.check_val[1] ? " -h":"",
cfg.check_val[2] ? " -f":"",
cfg.check_val[3] ? " -d":"",
cfg.check_val[4] ? " -a":"",
cfg.check_val[5] ? " -w":"",
cfg.spin_val[0], (int) cfg.spin_val[1],
filename );
fputs (command, stderr);
pfp = popen (command, "r");
g_free (command);
if (!pfp) {
perror ("dcraw");
return -1;
}
if (fscanf (pfp, "P%d %d %d 255%c", &depth, &width, &height, &nl) != 4
|| (depth-5)/2 ) {
pclose (pfp);
g_message ("Not a raw digital camera image.\n");
return -1;
}
depth = depth*2 - 9;
image = gimp_image_new (width, height, depth == 3 ? GIMP_RGB : GIMP_GRAY);
if (image == -1) {
pclose (pfp);
g_message ("Can't allocate new image.\n");
return -1;
}
gimp_image_set_filename (image, filename);
/* Create the "background" layer to hold the image... */
layer = gimp_layer_new (image, "Background", width, height,
depth == 3 ? GIMP_RGB_IMAGE : GIMP_GRAY_IMAGE,
100, GIMP_NORMAL_MODE);
gimp_image_add_layer (image, layer, 0);
/* Get the drawable and set the pixel region for our load... */
drawable = gimp_drawable_get (layer);
gimp_pixel_rgn_init (&pixel_region, drawable, 0, 0, drawable->width,
drawable->height, TRUE, FALSE);
/* Temporary buffers... */
tile_height = gimp_tile_height();
pixel = g_new (guchar, tile_height * width * depth);
/* Load the image... */
for (row = 0; row < height; row += tile_height) {
nrows = height - row;
if (nrows > tile_height)
nrows = tile_height;
fread (pixel, width * depth, nrows, pfp);
gimp_pixel_rgn_set_rect (&pixel_region, pixel, 0, row, width, nrows);
}
pclose (pfp);
g_free (pixel);
gimp_drawable_flush (drawable);
gimp_drawable_detach (drawable);
return image;
}
#if !GIMP_CHECK_VERSION(1,3,23)
/* this is set to true after OK click in any dialog */
gboolean result = FALSE;
static void callback_ok (GtkWidget * widget, gpointer data)
{
result = TRUE;
gtk_widget_destroy (GTK_WIDGET (data));
}
#endif
#define NCHECK (sizeof cfg.check_val / sizeof (gboolean))
gint load_dialog (gchar * name)
{
GtkWidget *dialog;
GtkWidget *table;
GtkObject *adj;
GtkWidget *widget;
int i;
static const char *label[9] =
{ "Quick interpolation", "Half-size interpolation",
"Four color interpolation", "Grayscale document",
"Automatic white balance", "Camera white balance",
"Brightness", "Highlight mode" };
gimp_ui_init ("rawphoto", TRUE);
dialog = gimp_dialog_new (_("Raw Photo Loader " PLUG_IN_VERSION), "rawphoto",
#if !GIMP_CHECK_VERSION(1,3,23)
gimp_standard_help_func, "rawphoto",
GTK_WIN_POS_MOUSE,
FALSE, TRUE, FALSE,
_("OK"), callback_ok, NULL, NULL, NULL, TRUE,
FALSE, _("Cancel"), gtk_widget_destroy, NULL,
1, NULL, FALSE, TRUE, NULL);
gtk_signal_connect
(GTK_OBJECT(dialog), "destroy", GTK_SIGNAL_FUNC(gtk_main_quit), NULL);
#else
NULL, 0,
gimp_standard_help_func, "rawphoto",
GTK_STOCK_CANCEL, GTK_RESPONSE_CANCEL,
GTK_STOCK_OK, GTK_RESPONSE_OK,
NULL);
#endif
table = gtk_table_new (9, 2, FALSE);
gtk_container_set_border_width (GTK_CONTAINER(table), 6);
gtk_box_pack_start
(GTK_BOX(GTK_DIALOG(dialog)->vbox), table, FALSE, FALSE, 0);
gtk_widget_show (table);
for (i=0; i < NCHECK; i++) {
widget = gtk_check_button_new_with_label
(_(label[i]));
gtk_toggle_button_set_active
(GTK_TOGGLE_BUTTON (widget), cfg.check_val[i]);
gtk_table_attach
(GTK_TABLE(table), widget, 0, 2, i, i+1, GTK_FILL, GTK_FILL, 0, 0);
gtk_signal_connect (GTK_OBJECT (widget), "toggled",
GTK_SIGNAL_FUNC (gimp_toggle_button_update),
&cfg.check_val[i]);
gtk_widget_show (widget);
}
for (i=NCHECK; i < NCHECK+2; i++) {
widget = gtk_label_new (_(label[i]));
gtk_misc_set_alignment (GTK_MISC (widget), 1.0, 0.5);
gtk_misc_set_padding (GTK_MISC (widget), 10, 0);
gtk_table_attach
(GTK_TABLE(table), widget, 0, 1, i, i+1, GTK_FILL, GTK_FILL, 0, 0);
gtk_widget_show (widget);
if (i == NCHECK+1)
widget = gimp_spin_button_new
(&adj, cfg.spin_val[i-NCHECK], 0, 9, 1, 9, 1, 1, 0);
else
widget = gimp_spin_button_new
(&adj, cfg.spin_val[i-NCHECK], 0.01, 4.0, 0.01, 0.1, 0.1, 0.1, 2);
gtk_table_attach
(GTK_TABLE(table), widget, 1, 2, i, i+1, GTK_FILL, GTK_FILL, 0, 0);
gtk_signal_connect (GTK_OBJECT (adj), "value_changed",
GTK_SIGNAL_FUNC (gimp_float_adjustment_update),
&cfg.spin_val[i-NCHECK]);
gtk_widget_show (widget);
}
gtk_widget_show (dialog);
#if !GIMP_CHECK_VERSION(1,3,23)
gtk_main();
gdk_flush();
return result;
#else
i = gimp_dialog_run (GIMP_DIALOG (dialog));
gtk_widget_destroy (dialog);
return i == GTK_RESPONSE_OK;
#endif
}

View File

@ -1,20 +1,19 @@
#! /bin/sh
# Call this script to update dcraw to latest version.
# Call this script to update dcraw files (except the main package) to latest version.
wget -N http://www.cybercom.net/~dcoffin/dcraw/dcraw.1
wget -N http://www.cybercom.net/~dcoffin/dcraw/parse.c
wget -N http://www.cybercom.net/~dcoffin/dcraw/fujiturn.c
wget -N http://www.cybercom.net/~dcoffin/dcraw/dcwrap
wget -N http://www.cybercom.net/~dcoffin/dcraw/dcraw.c
wget -N http://www.cybercom.net/~dcoffin/dcraw/.badpixels
wget -N http://www.cybercom.net/~dcoffin/dcraw/rawphoto.c
wget -N http://www.cybercom.net/~dcoffin/dcraw/clean_crw.c
wget -N http://www.cybercom.net/~dcoffin/dcraw/fuji_green.c
mv .badpixels badpixels
( URL="http://www.cybercom.net/~dcoffin/dcraw/" ; echo -e "$URL:\n" ; LC_ALL=C lynx -dump "$URL" | sed '1d;3,4d' ) >README
( URL="http://www.cybercom.net/~dcoffin/dcraw/" ; echo -e "$URL:\n" ; LC_ALL=C lynx -display_charset=utf-8 -dump "$URL" | sed '1d;3,4d' ) >README
wget -N http://www.cybercom.net/~dcoffin/dcraw/RCS/dcraw.c,v
rlog dcraw.c >dcraw.log
echo
echo "Please check, whether packaged file list is up to date."
echo "Don't forget to change the version in dcraw.spec." $(head -n 1 dcraw.c,v)
echo "You can look at dcraw.log for the complete change log."
echo "Before submit, please call:"
echo "rm dcraw.c,v dcraw.log"