@ -0,0 +1,15 @@ | |||
--- a/magic-lantern/tcc/Makefile | |||
+++ a/magic-lantern/tcc/Makefile | |||
@@ -137,6 +137,12 @@ | |||
TCCLIBS+=$(LIBTCC1_CROSS) | |||
endif | |||
+#Very bad workaround to solve compilation issues | |||
+CC=../gcc-arm-none-eabi-4_8-2013q4/bin/arm-none-eabi-gcc-4.8.3 | |||
+LD=../gcc-arm-none-eabi-4_8-2013q4/bin/arm-none-eabi-ld | |||
+READELF=../gcc-arm-none-eabi-4_8-2013q4/bin/arm-none-eabi-readelf | |||
+OBJCOPY=../gcc-arm-none-eabi-4_8-2013q4/bin/arm-none-eabi-objcopy | |||
+ | |||
#all: $(PROGS) $(TCCLIBS) $(TCCDOCS) | |||
all: libtccx.o |
@ -0,0 +1,71 @@ | |||
--- a/magic-lantern/modules/dual_iso/cr2hdr.c | |||
+++ b/magic-lantern/modules/dual_iso/cr2hdr.c | |||
@@ -60,6 +60,7 @@ | |||
/** Command-line interface */ | |||
+int process_method = 0; | |||
int interp_method = 0; /* 0:amaze-edge, 1:mean23 */ | |||
int chroma_smooth_method = 2; | |||
int fix_pink_dots = 0; | |||
@@ -98,7 +99,13 @@ | |||
void check_shortcuts() | |||
{ | |||
- if (shortcut_fast) | |||
+ if (process_method == 1) | |||
+ { | |||
+ interp_method = 2; | |||
+ chroma_smooth_method = 1; | |||
+ gray_wb = 5; | |||
+ } | |||
+ else if (shortcut_fast) | |||
{ | |||
interp_method = 1; | |||
chroma_smooth_method = 0; | |||
@@ -129,6 +136,13 @@ | |||
struct cmd_group options[] = { | |||
{ | |||
+ "Processing methods", (struct cmd_option[]) { | |||
+ { &process_method, 0, "--process", "Process Dual ISO compatible file (default)" }, | |||
+ { &process_method, 1, "--dry-run", "Only check file for Dual ISO presence" }, | |||
+ OPTION_EOL | |||
+ }, | |||
+ }, | |||
+ { | |||
"Shortcuts", (struct cmd_option []) { | |||
{ &shortcut_fast, 1, "--fast", "disable most postprocessing steps (fast, but low quality)\n" | |||
" (--mean23, --no-cs, --no-fullres, --no-alias-map, --no-stripe-fix, --no-bad-pix)" }, | |||
@@ -870,12 +884,12 @@ | |||
whites[num_files] = raw_info.white_level; | |||
num_files++; | |||
} | |||
- else | |||
+ else if (process_method != 1) | |||
{ | |||
printf("ISO blending didn't work\n"); | |||
} | |||
} | |||
- else | |||
+ else if (process_method != 1) | |||
{ | |||
printf("Doesn't look like interlaced ISO\n"); | |||
} | |||
@@ -2206,7 +2220,15 @@ | |||
double corr_ev = 0; | |||
int white_darkened = white_bright; | |||
int ok = match_exposures(&corr_ev, &white_darkened); | |||
- if (!ok) goto err; | |||
+ if (!ok) | |||
+ { | |||
+ goto err; | |||
+ } | |||
+ else if (ok && process_method == 1) | |||
+ { | |||
+ printf("Interlaced ISO detected\n"); /*. File: %s\n", filename);*/ | |||
+ return 0; | |||
+ } | |||
/* run a second black subtract pass, to fix whatever our funky processing may do to blacks */ | |||
black_subtract_simple(raw_info.active_area.x1, raw_info.active_area.y1); |
@ -0,0 +1,11 @@ | |||
--- a/magic-lantern/modules/dual_iso/exiftool-bridge.c | |||
+++ a/magic-lantern/modules/dual_iso/exiftool-bridge.c | |||
@@ -10,7 +10,7 @@ | |||
{ | |||
char exif_cmd[1000]; | |||
printf("%-16s: copying EXIF from %s\n", dest, source); | |||
- snprintf(exif_cmd, sizeof(exif_cmd), "exiftool -tagsFromFile \"%s\" -all:all \"-xmp:subject=Dual-ISO\" \"-UniqueCameraModel<Model\" \"%s\" -overwrite_original -q", source, dest); | |||
+ snprintf(exif_cmd, sizeof(exif_cmd), "exiftool -tagsFromFile \"%s\" -all:all \"-xmp:subject=Dual ISO DNG\" \"-UniqueCameraModel<Model\" \"-BaselineExposure=0.25\" \"-BaselineNoise=0.8\" \"-BaselineSharpness=1.2\" \"-BayerGreenSplit=100\" \"%s\" -overwrite_original -q", source, dest); | |||
int r = system(exif_cmd); | |||
if(r!=0) | |||
{ |
@ -0,0 +1,32 @@ | |||
--- a/magic-lantern/modules/dual_iso/cr2hdr.c | |||
+++ b/magic-lantern/modules/dual_iso/cr2hdr.c | |||
@@ -53,10 +53,10 @@ | |||
#include "timing.h" | |||
#include "kelvin.h" | |||
-#define MODULE_STRINGS_PREFIX dual_iso_strings | |||
+/* #define MODULE_STRINGS_PREFIX dual_iso_strings | |||
#include "../module_strings_wrapper.h" | |||
#include "module_strings.h" | |||
-MODULE_STRINGS() | |||
+MODULE_STRINGS() */ | |||
/** Command-line interface */ | |||
@@ -570,14 +570,14 @@ | |||
int main(int argc, char** argv) | |||
{ | |||
printf("cr2hdr: a post processing tool for Dual ISO images\n\n"); | |||
- printf("Last update: %s\n", module_get_string(dual_iso_strings, "Last update")); | |||
+ /* printf("Last update: %s\n", module_get_string(dual_iso_strings, "Last update")); */ | |||
fast_randn_init(); | |||
if (argc == 1) | |||
{ | |||
printf("No input files.\n\n"); | |||
- printf("GUI usage: drag some CR2 or DNG files over cr2hdr.exe.\n\n"); | |||
+ /* printf("GUI usage: drag some CR2 or DNG files over cr2hdr.exe.\n\n"); */ | |||
show_commandline_help(argv[0]); | |||
return 0; | |||
} |
@ -0,0 +1,11 @@ | |||
--- a/magic-lantern/modules/Makefile.modules | |||
+++ b/magic-lantern/modules/Makefile.modules | |||
@@ -14,7 +14,7 @@ | |||
MODULE_DEP = $(MODULE_NAME).dep | |||
MODULE_DEPS = $(MODULE_NAME).d | |||
-MODULE_STRINGS = module_strings.h | |||
+MODULE_STRINGS = | |||
HGDIFF_OBJS = hgdiff.tmp | |||
@ -0,0 +1 @@ | |||
ARM_PATH=$(TOP_DIR)/gcc-arm-none-eabi-4_8-2013q4 |
@ -0,0 +1,102 @@ | |||
# Maintainer: Pekka Helenius <fincer89 at hotmail DOT com> | |||
pkgname=magiclantern-tools | |||
pkgver=1 | |||
pkgrel=1 | |||
pkgdesc="Magic Lantern image processing tools for Canon DSLR's with Magic Lantern firmware." | |||
arch=('any') | |||
url='https://bitbucket.org/hudson/magic-lantern' | |||
license=("GPL") | |||
depends=('perl-image-exiftool' 'dcraw') | |||
optdepends=('octave') | |||
makedepends=('mercurial') | |||
#REQUIRED BY MODULES | |||
#Use these dependencies only if you try compile more modules. They rely partially on rst2html5 package. | |||
#makedepends=rst2html5 python-docutils | |||
arm_compiler=gcc-arm-none-eabi-4_8-2013q4 | |||
source=( | |||
#https://launchpad.net/gcc-arm-embedded/4.8/4.8-2013-q4-major/+download/$arm_compiler-20131204-linux.tar.bz2 | |||
gcc-arm-none-eabi-4_8-2013q4-20131204-linux.tar.bz2 #local source | |||
magic-lantern_source_30092017.tar.bz2 #local source | |||
Makefile.user | |||
01-patch_tcc_makefile-fix.patch | |||
02_patch_cr2hdr-source_add-dryrun.patch | |||
03_patch_add_baseline-exif.patch | |||
04_patch_cr2hdr_disable-strings.patch | |||
05_patch_modules-makefile_disable-strings.patch | |||
) | |||
md5sums=('4869e6a6e1dc11ea0835e8b8213bb194' | |||
'5f32b3c128cccebdac1520d442b95c95' | |||
'035e3049e5f3205680566ffc6c6e9023' | |||
'2adcdf6ed3a6cec7b7594ef310d5737a' | |||
'2a921d40e65004bb0f9f4d274b83ff04' | |||
'317c4ce8317182a98700b57b285ef184' | |||
'd2e57664cbc7310521eee4b0b13a3f41' | |||
'25281350b6a5a9f40a1b40933f0de829') | |||
prepare() { | |||
cd "$srcdir"/ | |||
##### | |||
#Download Magic Lantern latest source files | |||
#hg clone -r unified https://bitbucket.org/hudson/magic-lantern | |||
##### | |||
#This is an ugly hack, I know. Make sure you update the patch file if you change ARM compiler | |||
patch -Np1 -i "$srcdir"/01-patch_tcc_makefile-fix.patch | |||
#Implement Dry Run feature in CR2HDR | |||
patch -Np1 -i "$srcdir"/02_patch_cr2hdr-source_add-dryrun.patch | |||
#Write Baseline Exposure values to EXIF tags: | |||
patch -Np1 -i "$srcdir"/03_patch_add_baseline-exif.patch | |||
#All modules have python issues (outdated code?) so they don't compile. The problem is related to version etc. strings. Just disable them and compile the code. Only used for cr2hdr (as we need it, not other modules) | |||
patch -Np1 -i "$srcdir"/04_patch_cr2hdr_disable-strings.patch | |||
patch -Np1 -i "$srcdir"/05_patch_modules-makefile_disable-strings.patch | |||
#Custom compilation settings for Magic Lantern (Mainly ARM compiler path redefinition) | |||
ln -s "$srcdir"/Makefile.user "$srcdir"/magic-lantern/Makefile.user | |||
#Link downloaded ARM compiler files to Magic Lantern directory | |||
ln -s "$srcdir"/$arm_compiler "$srcdir"/magic-lantern/$arm_compiler | |||
} | |||
build() { | |||
cd "$srcdir"/magic-lantern #/modules/dual_iso | |||
####################################### | |||
# FIRMWARE - MODULES FAIL TO BUILD DUE TO PYTHON ISSUES | |||
##make 5D3 #5D Mark 3 - Both firmwares - DOESN'T INCLUDE MODULES YET | |||
##make 5D3.113 #5D Mark 3 - Firmware 1.1.3 - DOESN'T INCLUDE MODULES YET | |||
#make 5D3.123 #5D Mark 3 - Firmware 1.2.3 - DOESN'T INCLUDE MODULES YET | |||
#mkdir -p "$startdir"/5dmark3_firmware_123/ | |||
#cp "$srcdir"/magic-lantern/platform/5D3.123/{autoexec.bin,ML-SETUP.FIR} "$startdir"/5dmark3_firmware_123/ #magiclantern.bin,version.bin | |||
####################################### | |||
# MODULES | |||
#make all_modules #All modules - FAIL TO BUILD DUE TO PYTHON ISSUES | |||
#CR2HDR application for host computer | |||
cd "$srcdir"/magic-lantern/modules/dual_iso | |||
make cr2hdr | |||
cd .. | |||
#MLV_DUMP application for host computer | |||
cd "$srcdir"/magic-lantern/modules/mlv_rec | |||
make mlv_dump | |||
cd .. | |||
} | |||
package() | |||
{ | |||
mkdir -p "$pkgdir"/usr/bin | |||
cp "$srcdir"/magic-lantern/modules/dual_iso/cr2hdr "$pkgdir"/usr/bin | |||
cp "$srcdir"/magic-lantern/modules/mlv_rec/mlv_dump "$pkgdir"/usr/bin/mlvdump | |||
} |
@ -0,0 +1,57 @@ | |||
# Magic Lantern cr2hdr tool - customized | |||
This directory contains files to compile Magic Lantern cr2hdr dual ISO conversion tool on Linux (Arch Linux preferred). | |||
Patches in this directory have some custom features which are not found in the original cr2hdr version. These features include: | |||
- added support for `--dry-run` parameter for cr2hdr | |||
- When `--dry-run` is enabled, the actual conversion is not done. The tool just checks that conversion is possible | |||
- This is handy in scripts where we just want to distinguish normal single ISO CR2 files from Dual ISO ones and then perform some custom action | |||
- added support for `baseline` metadata export. Following tags are exported: | |||
- Baseline Exposure (sample value: 0.25) | |||
- Baseline Noise (sample value: 0.8) | |||
- Baseline Sharpness (sample value: 1.2) | |||
- These values affect RAW image post-processing | |||
- [More about the meaning of Baseline values](https://www.rawdigger.com/howtouse/deriving-hidden-ble-compensation) | |||
## Custom patches | |||
### 01-patch_tcc_makefile-fix.patch | |||
- A very bad workaround for solving compilation issues (hard-links some required stuff) | |||
### 02_patch_cr2hdr-source_add-dryrun.patch | |||
- Add dry run implementation for cr2hdr | |||
### 03_patch_add_baseline-exif.patch | |||
- Add baseline exif tags for converted dual ISO files (DNG format) | |||
### 04_patch_cr2hdr_disable-strings.patch | |||
- Remove some unnecessary and Windows-specific strings from cr2hdr entries | |||
### 05_patch_modules-makefile_disable-strings.patch | |||
- Disable `module_strings.h` in a cr2hdr modules file | |||
## Working cr2hdr and other software versions - archives | |||
The following versions have been tested: | |||
- gcc-arm-none-eabi-4_8-2013q4-20131204-linux.tar.bz2 | |||
- MD5sum: 4869e6a6e1dc11ea0835e8b8213bb194 | |||
- magic-lantern_source_30092017.tar.bz2 | |||
- MD5sum: 1df9f79ad7e549d95f0065d3d00247f4 |
@ -0,0 +1,26 @@ | |||
# Maintainer: Pekka Helenius <fincer89 at hotmail DOT com> | |||
# Source code files by Trammell Hudson // Magic Lantern | |||
pkgname=magiclantern-bootablecard | |||
pkgver=1 | |||
pkgrel=1 | |||
pkgdesc='Create a Magic Lantern compatible SD card for Canon EOS cameras (enable boot flag).' | |||
arch=('i686' 'x86_64') | |||
license=('GPL') | |||
url='https://bitbucket.org/hudson/magic-lantern/src/tip/contrib/make-bootable/' | |||
depends=('exfat-dkms-git' 'coreutils' 'exfat-utils-nofuse' 'util-linux') | |||
makedepends=('gcc') | |||
source=(magiclantern-bootablecard.tar.gz) | |||
md5sums=('50a78cd16d2d05b78c0273fe53a59236') | |||
build() { | |||
gcc exfat_sum.c -I$srcdir/modules/lua/dietlibc/include/ -o $srcdir/exfat_sum | |||
} | |||
package() { | |||
mkdir -p $pkgdir/usr/bin/ | |||
install -m755 $srcdir/{make_bootable.sh,exfat_sum} $pkgdir/usr/bin/ | |||
mv $pkgdir/usr/bin/make_bootable.sh $pkgdir/usr/bin/ml-bootablecard | |||
chmod +x $pkgdir/usr/bin/ml-bootablecard | |||
} |
@ -0,0 +1,13 @@ | |||
# Magic Lantern bootable card on Linux | |||
Create a bootable Magic Lantern compatible SD card for Canon DSLRs on Linux. Adds necessary boot flag to the card. | |||
## PKGBUILD | |||
Arch Linux specific script file to compile this tool from source | |||
## magiclantern-bootablecard.tar.gz | |||
Contains files which are released under GPL at: | |||
[Trammell Hudson - Magic Lantern: make-bootable // bitbucket.org](https://bitbucket.org/hudson/magic-lantern/src/tip/contrib/make-bootable/) |
@ -0,0 +1,31 @@ | |||
--- a/src/qtterminal/QtGnuplotWindow.cpp | |||
+++ b/src/qtterminal/QtGnuplotWindow.cpp | |||
@@ -113,11 +113,14 @@ | |||
exportMenu->addAction(exportPngAction); | |||
exportAction->setMenu(exportMenu); | |||
m_toolBar->addAction(exportAction); | |||
- createAction(tr("Replot") , 'e', ":/images/replot"); | |||
createAction(tr("Show grid") , 'g', ":/images/grid"); | |||
createAction(tr("Previous zoom"), 'p', ":/images/zoomPrevious"); | |||
createAction(tr("Next zoom") , 'n', ":/images/zoomNext"); | |||
- createAction(tr("Autoscale") , 'a', ":/images/autoscale"); | |||
+ createAction(tr("Reset Zoom") , 'u', ":/images/autoscale"); | |||
+ //createAction(tr("Autoscale") , 'a', ":/images/autoscale"); | |||
+ createAction(tr("Invert plots") , 'i', ":/images/invert"); | |||
+ createAction(tr("Hide all plots") , 'V', ":/images/hide"); | |||
+ createAction(tr("Show all plots") , 'v', ":/images/replot"); | |||
m_toolBar->addAction(settingsAction); | |||
loadSettings(); | |||
--- a/src/qtterminal/QtGnuplotResource.qrc | |||
+++ b/src/qtterminal/QtGnuplotResource.qrc | |||
@@ -13,5 +13,7 @@ | |||
<file alias="images/zoomNext">images/zoom-in.png</file> | |||
<file alias="images/autoscale">images/zoom-original.png</file> | |||
<file alias="images/settings">images/configure.png</file> | |||
+ <file alias="/images/hide">images/view-hide.png</file> | |||
+ <file alias="/images/invert">images/view-invert.png</file> | |||
</qresource> | |||
-</RCC> | |||
\ No newline at end of file | |||
+</RCC> |
@ -0,0 +1,14 @@ | |||
[Desktop Entry] | |||
Type=Service | |||
ServiceTypes=KonqPopupMenu/Plugin | |||
Icon=application-x-theme | |||
MimeType=image/x-canon-cr2;image/x-adobe-dng;text/csv; | |||
Actions=statistics; | |||
X-KDE-StartupNotify=false | |||
X-KDE-Priority=TopLevel | |||
X-KDE-Submenu=Image Tools | |||
[Desktop Action statistics] | |||
Name=Statistics | |||
Icon=application-x-theme | |||
Exec=/usr/share/kservices5/ServiceMenus/imagetools_01_exif_statistics.sh %F |
@ -0,0 +1,19 @@ | |||
[Desktop Entry] | |||
Type=Service | |||
ServiceTypes=KonqPopupMenu/Plugin | |||
Icon=application-x-theme | |||
MimeType=image/x-canon-cr2;image/x-adobe-dng; | |||
Actions=convert_dualiso;raw_tags; | |||
X-KDE-StartupNotify=false | |||
X-KDE-Priority=TopLevel | |||
X-KDE-Submenu=Image Tools | |||
[Desktop Action convert_dualiso] | |||
Name=Detect & convert Dual ISO | |||
Icon=application-x-theme | |||
Exec=/usr/share/kservices5/ServiceMenus/imagetools_02_dualiso.sh %F | |||
[Desktop Action raw_tags] | |||
Name=Rename, Uncrop & Add Baseline Tags | |||
Icon=application-x-theme | |||
Exec=/usr/share/kservices5/ServiceMenus/imagetools_03_raw_resolution-baseline.sh %F |
@ -0,0 +1,19 @@ | |||
[Desktop Entry] | |||
Type=Service | |||
ServiceTypes=KonqPopupMenu/Plugin | |||
Icon=application-x-theme | |||
MimeType=x-canon-mlv; | |||
Actions=mlvdump;mlvinfo; | |||
X-KDE-StartupNotify=false | |||
X-KDE-Priority=TopLevel | |||
X-KDE-Submenu=Image Tools | |||
[Desktop Action mlvdump] | |||
Name=Extract all DNG frames | |||
Icon=application-x-theme | |||
Exec=/usr/share/kservices5/ServiceMenus/imagetools_05_mlvdump.sh %F | |||
[Desktop Action mlvinfo] | |||
Name=About this MLV file | |||
Icon=application-x-theme | |||
Exec=/usr/share/kservices5/ServiceMenus/imagetools_06_mlvinfo.sh %F |
@ -0,0 +1,19 @@ | |||
[Desktop Entry] | |||
Type=Service | |||
ServiceTypes=KonqPopupMenu/Plugin | |||
Icon=application-x-theme | |||
MimeType=image/jpeg;image/png; | |||
Actions=exif_deletedata;exif_deletedata_critical; | |||
X-KDE-StartupNotify=false | |||
X-KDE-Priority=TopLevel | |||
X-KDE-Submenu=Image Tools | |||
[Desktop Action exif_deletedata] | |||
Name=Delete EXIF metadata | |||
Icon=application-exit | |||
Exec=/usr/share/kservices5/ServiceMenus/imagetools_06_exif_deletedata.sh %F | |||
[Desktop Action exif_deletedata_critical] | |||
Name=Delete critical EXIF metadata | |||
Icon=application-exit | |||
Exec=/usr/share/kservices5/ServiceMenus/imagetools_06_exif_deletedata_critical.sh %F |
@ -0,0 +1,14 @@ | |||
[Desktop Entry] | |||
Type=Service | |||
ServiceTypes=KonqPopupMenu/Plugin | |||
Icon=application-x-theme | |||
MimeType=image/tiff; | |||
Actions=ale_imagestack; | |||
X-KDE-StartupNotify=false | |||
X-KDE-Priority=TopLevel | |||
X-KDE-Submenu=Image Tools | |||
[Desktop Action ale_imagestack] | |||
Name=Stack TIFF images | |||
Icon=application-exit | |||
Exec=/usr/share/kservices5/ServiceMenus/imagetools_07_ale_stack.sh %f |
@ -0,0 +1 @@ | |||
@ -0,0 +1,49 @@ | |||
# Maintainer: Pekka Helenius <fincer89 at hotmail DOT com> | |||
pkgname=kde-servicemenus-imagetools | |||
pkgver=1 | |||
pkgrel=1 | |||
pkgdesc="Useful combination of tools for processing various images (KDE5 Dolphin action)" | |||
url=() | |||
arch=('any') | |||
license=('GPL') | |||
install='' | |||
source=(imagetools_01_exif_statistics.sh | |||
imagetools_02_dualiso.sh | |||
imagetools_03_raw_resolution-baseline.sh | |||
imagetools_04_mlvdump.sh | |||
imagetools_05_mlvinfo.sh | |||
imagetools_06_exif_deletedata.sh | |||
imagetools_06_exif_deletedata_critical.sh | |||
imagetools_07_ale_stack.sh | |||
01_imagetools-statistics.desktop | |||
02_imagetools-dng-cr2.desktop | |||
03_imagetools-mlv.desktop | |||
04_imagetools-jpg-png.desktop | |||
05_imagetools-imagestack.desktop) | |||
#xwinkill) #Workaround for bug: https://sourceforge.net/p/gnuplot/bugs/1659/ | |||
depends=('magiclantern-tools' 'perl-image-exiftool' 'ale' 'dcraw' 'netpbm' 'gnuplot' 'coreutils' 'dolphin') | |||
optdepends=() | |||
conflicts=() | |||
makedepends=() | |||
md5sums=('b4c1f2f5906a56c5cd5404415b26ad5b' | |||
'a84bf74fb67a5f6f2289ebee2ce4452e' | |||
'6e81d48727e7fc6922a2aed0ce7810c1' | |||
'a7e0c36553ff59d182460a2108163798' | |||
'01756513818969a07ff61a1ee648106b' | |||
'75588a9f375ac5c6f6f245d12cc315d5' | |||
'c294e69b9f6e714a307306fd4301fd61' | |||
'88cbadd0f290c737f7f0660a7029029d' | |||
'93bb82eec8ead83b5b5369822d44d780' | |||
'940848e05d6c6400eac97a998fb0f26b' | |||
'be883bb11a24c4f7ac6452f3cab6cf66' | |||
'9170a5e116fc2eede5325d0a985931dc' | |||
'531f2b73b8514430a772a61a10de097f') | |||
package() { | |||
mkdir -p $pkgdir/usr/share/kservices5/ServiceMenus/ | |||
cp $srcdir/{imagetools_01_exif_statistics.sh,imagetools_02_dualiso.sh,imagetools_03_raw_resolution-baseline.sh,imagetools_04_mlvdump.sh,imagetools_05_mlvinfo.sh,imagetools_06_exif_deletedata.sh,imagetools_06_exif_deletedata_critical.sh,imagetools_07_ale_stack.sh,01_imagetools-statistics.desktop,02_imagetools-dng-cr2.desktop,03_imagetools-mlv.desktop,04_imagetools-jpg-png.desktop,05_imagetools-imagestack.desktop} $pkgdir/usr/share/kservices5/ServiceMenus/ | |||
chmod 755 $pkgdir/usr/share/kservices5/ServiceMenus/{imagetools_01_exif_statistics.sh,imagetools_02_dualiso.sh,imagetools_03_raw_resolution-baseline.sh,imagetools_04_mlvdump.sh,imagetools_05_mlvinfo.sh,imagetools_06_exif_deletedata.sh,imagetools_06_exif_deletedata_critical.sh,imagetools_07_ale_stack.sh,01_imagetools-statistics.desktop,02_imagetools-dng-cr2.desktop,03_imagetools-mlv.desktop,04_imagetools-jpg-png.desktop,05_imagetools-imagestack.desktop} | |||
#chmod +x $pkgdir/usr/share/kservices5/ServiceMenus/xwinkill | |||
} |
@ -0,0 +1,173 @@ | |||
#!/bin/bash | |||
# Batch convert multiple Magic Lantern dual ISO image files on Linux | |||
# Copyright (C) 2017 Pekka Helenius | |||
# | |||
# This program is free software; you can redistribute it and/or | |||
# modify it under the terms of the GNU General Public License | |||
# as published by the Free Software Foundation; either version 2 | |||
# of the License, or (at your option) any later version. | |||
# | |||
# This program is distributed in the hope that it will be useful, | |||
# but WITHOUT ANY WARRANTY; without even the implied warranty of | |||
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the | |||
# GNU General Public License for more details. | |||
# | |||
# You should have received a copy of the GNU General Public License | |||
# along with this program; if not, write to the Free Software | |||
# Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. | |||
# | |||
############################################### | |||
# NOTE: This script REQUIRES a patched cr2hdr tool with '--dry-run' parameter support!! | |||
# Required patch file is provided in the same repository with this script | |||
#Brackets and quotation marks in variables prevent errors occuring if file paths with spaces is used. | |||
################################################################################################ | |||
# File system check | |||
# We don't allow writing to SD card. | |||
#Sed is here to remove any trailing spaces and crap like blank lines | |||
INPUT_FILESYSTEM=$(df -h "${1}" | awk -F ' ' 'FNR> 1 {print $1}' | grep -i -E "/dev/sd?|/dev/hd?" | sed '/^\s*$/d' | wc -l) | |||
if [[ "${INPUT_FILESYSTEM}" -eq 0 ]]; then #if input file (first file printed in bash) filesystem does not start with /dev/sdX | |||
kdialog --error "Image(s) are in a SD Card. Please move them your local or external storage and try again." | |||
exit | |||
fi | |||
################################################################################################ | |||
#We get the directory just from the first filename. Pwd should be easier, but bugged, so... | |||
INPUT_DIR=$(dirname "${1}") | |||
DIR_BASENAME=$(echo "${INPUT_DIR}" | rev | cut -d/ -f 1 | rev) | |||
echo "DEBUG: Input dir is $INPUT_DIR" | |||
mkdir -p "${INPUT_DIR}"/converted_dual_iso | |||
echo "DEBUG: 'converted_dual_iso' directory created" | |||
############################################################################################ | |||
####PROGRESSBAR STUFF - BEGIN | |||
LABELTEXT='Processing RAW images...' | |||
numargs=$# # Number of all files | |||
tics=100 # Percentage tics | |||
inc=0 # Current file number | |||
mltp=1000 # Percentage multiplier for bash | |||
dbusRef=$(kdialog --title "Dual ISO (folder: ${DIR_BASENAME})" --progressbar "$LABELTEXT" $tics) | |||
qdbus $dbusRef showCancelButton true | |||
####PROGRESSBAR STUFF - END | |||
while [[ $# -gt 0 ]] && [[ $(qdbus $dbusRef wasCancelled) == "false" ]]; do | |||
INPUT="${1}" #Input file path, full path like: /home/myhome/IMG_4021.CR2 | |||
OLDFILE_CR2=$(basename "${INPUT}") #Output as IMG_4021.CR2 (for example) | |||
# Once we do this, it's very clear which kind of CR2 file we're talking about here. | |||
NEWFILE_CR2=$(basename "${INPUT}" | sed 's/\.\w*$/_dualiso.CR2/') | |||
# Converted Dual ISO file. | |||
NEWFILE_DNG=$(basename "${INPUT}" | sed 's/\.\w*$/_dualiso.DNG/') | |||
#If converted Dual ISO exists already, we skip the conversion process. This passes only if the file doesn't exist. | |||
if [[ ! -e "${INPUT_DIR}"/converted_dual_iso/"${NEWFILE_DNG}" ]]; then | |||
if [[ $(cr2hdr --dry-run "${INPUT}" | grep "Interlaced ISO detected" | wc -l) == 1 ]]; then # Test an input file for Dual ISO. | |||
echo "Interlaced ISO detected: ${OLDFILE_CR2}" | |||
#Rename detected dual ISO CR2 file with a proper prefix (so that we can distinguish Dual ISO images from "normal" CR2 files) | |||
mv "${INPUT_DIR}"/"${OLDFILE_CR2}" "${INPUT_DIR}"/"${NEWFILE_CR2}" | |||
#Input we will use from this point is the renamed file, so we set INPUT variable to point to the renamed file. | |||
INPUT="${INPUT_DIR}"/"${NEWFILE_CR2}" | |||
cr2hdr --process "${INPUT}" # Process a valid input file. | |||
mv "${INPUT_DIR}"/"${NEWFILE_DNG}" "${INPUT_DIR}"/converted_dual_iso/ # Move converted Dual ISO. | |||
# Add Subject=Dual-ISO tag for every Dual ISO CR2 file. | |||
echo "Writing new EXIF/XMP tag Subject: Dual ISO CR2" | |||
exiftool -xmp:subject='Dual ISO CR2' "${INPUT_DIR}"/"${NEWFILE_CR2}" -overwrite_original | |||
fi | |||
fi | |||
############################################## | |||
####PROGRESSBAR STUFF - BEGIN | |||
let inc++ | |||
#Percentage needs to be calculated like this due to bash rounding limitations... | |||
PERCENT_VALUE=$((($mltp*$tics)/(200*$numargs/$inc % 2 + $mltp*$numargs/$inc))) | |||
#Output: 20, 40, 59, 80, 100 etc. | |||
qdbus $dbusRef Set "" "value" $PERCENT_VALUE; | |||
qdbus $dbusRef setLabelText "$LABELTEXT ($inc/$numargs)"; | |||
####PROGRESSBAR STUFF - END | |||
shift #Process next CR2/DNG file... | |||
done | |||
############################################## | |||
#Close processing window if cancelled event has been triggered. | |||
####PROGRESSBAR STUFF - BEGIN | |||
# If the process was cancelled, remove tmp file and exit the script. | |||
if [[ ! $(qdbus $dbusRef wasCancelled) == "false" ]]; then | |||
exit | |||
fi | |||
############################################## | |||
#Close processing window if not cancelled and processing finished. | |||
qdbus $dbusRef close | |||
####PROGRESSBAR STUFF - END | |||
############################################## | |||
if [ $(pgrep -x 'cr2hdr' | wc -l) == 0 ]; then | |||
notify-send 'Dual ISO' -i image-x-krita 'Conversion done!' | |||
fi | |||
############################################################################################ | |||
QUESTCOUNT=0 #Ask this question only once | |||
#Dual ISO (Subject only defined in converted Dual ISO DNG images) | |||
for i in $(find "${INPUT_DIR}" -maxdepth 1 -type f -iname "*.DNG"); do | |||
if [[ ! -z $(echo -n $i) ]] && [[ $(exiftool $i |grep --max-count=1 "Subject" | sed -e 's/.*: //g') == *"Dual-ISO"* ]] ; then | |||
if [[ $QUESTCOUNT == 0 ]]; then | |||
QUESTION=$(kdialog --yesno "More Dual ISO files detected in '$(echo ${INPUT_DIR} | rev | cut -d/ -f1 | rev)' main folder. Do you want to move these files into 'converted_dual_iso' folder?";) | |||
echo $QUESTION | |||
MOVEALL=true | |||
let QUESTCOUNT++ | |||
else | |||
MOVEALL=false | |||
fi | |||
if [[ $MOVEALL == true ]]; then | |||
mv $i "${INPUT_DIR}"/converted_dual_iso/ | |||
echo "DEBUG: all detected Dual ISO images moved to 'converted_dual_iso' folder" | |||
fi | |||
fi | |||
done | |||
############################################################################################ | |||
#If there are no files converted, we delete converted_dual_iso folder | |||
if [[ $(ls "${INPUT_DIR}"/converted_dual_iso | wc -l) == 0 ]]; then | |||
rm -Rf "${INPUT_DIR}"/converted_dual_iso | |||
echo "DEBUG: 'converted_dual_iso' empty, so deleted" | |||
fi | |||
exit |
@ -0,0 +1,519 @@ | |||
#!/bin/bash | |||
# Add CR2 tags: Baseline, Subject (to distinguish Single & Dual ISOs) | |||
# Copyright (C) 2017 Pekka Helenius | |||
# | |||
# This program is free software; you can redistribute it and/or | |||
# modify it under the terms of the GNU General Public License | |||
# as published by the Free Software Foundation; either version 2 | |||
# of the License, or (at your option) any later version. | |||
# | |||
# This program is distributed in the hope that it will be useful, | |||
# but WITHOUT ANY WARRANTY; without even the implied warranty of | |||
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the | |||
# GNU General Public License for more details. | |||
# | |||
# You should have received a copy of the GNU General Public License | |||
# along with this program; if not, write to the Free Software | |||
# Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. | |||
# | |||
############################################### | |||
# File system check | |||
# We don't allow writing to SD card. | |||
#Sed is here to remove any trailing spaces and crap like blank lines | |||
INPUT_FILESYSTEM=$(df -h "${1}" | awk -F ' ' 'FNR> 1 {print $1}' | grep -i -E "/dev/sd?|/dev/hd?" | sed '/^\s*$/d' | wc -l) | |||
if [[ "${INPUT_FILESYSTEM}" -eq 0 ]]; then #if input file (first file printed in bash) filesystem does not start with /dev/sdX | |||
kdialog --error "Image(s) are in a SD Card. Please move them your local or external storage and try again." | |||
exit | |||
fi | |||
################################################################################################ | |||
#We get the directory just from the first filename. Pwd should be easier, but bugged, so... | |||
INPUT_DIR=$(dirname "${1}") | |||
DIR_BASENAME=$(echo "${INPUT_DIR}" | rev | cut -d/ -f 1 | rev) | |||
#Camera resolution in pixels (absolute limit, we can't exceed these pixel values!) | |||
C5DMK3_WIDTH=5796 | |||
C5DMK3_HEIGHT=3870 | |||
# In a case or emergency (can't open a picture etc), revert this values to 5760 x 3840 | |||
################################################################################################ | |||
####PROGRESSBAR STUFF - BEGIN | |||
LABELTEXT='Processing RAW images...' | |||
numargs=$# # Number of all files | |||
tics=100 # Percentage tics | |||
inc=0 # Current file number | |||
mltp=1000 # Percentage multiplier for bash | |||
dbusRef=$(kdialog --title "EXIF Tags (folder: ${DIR_BASENAME})" --progressbar "$LABELTEXT" $tics) | |||
qdbus $dbusRef showCancelButton true | |||
####PROGRESSBAR STUFF - END | |||
while [[ $# -gt 0 ]] && [[ $(qdbus $dbusRef wasCancelled) == "false" ]]; do | |||
################################################################ | |||
# Values that change during the while loop (differ from file to file) | |||
INPUT="${1}" | |||
INPUT_BASENAME=$(basename "${INPUT}" | cut -f 1 -d '.') | |||
INPUT_EXTENSION=$(echo $(basename "${INPUT}" | cut -f 2 -d '.' | sed '/^\s*$/d')) #Get the correct file extension for an input file (so the new one will use the same) | |||
SUBJECT=$(exiftool "${INPUT}" | grep "Subject") | |||
SUBJECT_SINGLEISO=$(exiftool "${INPUT}" | grep "Subject" | grep "Single ISO") | |||
SUBJECT_DUALISO=$(exiftool "${INPUT}" | grep "Subject" | grep "Dual ISO") | |||
#This is just for compatibility | |||
SUBJECT_DUALISO_OLD=$(exiftool "${INPUT}" | grep "Subject" | grep "Dual-ISO") | |||
BASELINES=$(exiftool "${INPUT}" | grep "Baseline Exposure") | |||
C5DMK3_CHECK=$(exiftool "${INPUT}" |grep -i "5D Mark III" |wc -l) | |||
CROPHEIGHT_CHECK_VALUE=$(echo -n $(exiftool "${INPUT}" |grep -i "Cropped Image Height" | sed 's/[^0-9]*//g')) | |||
ISO_VALUE=$(echo -n $(exiftool "${INPUT}" | grep "Recommended Exposure Index" | grep -v "Sensitivity Type" | sed 's/[^0-9]*//g')) | |||
################################################################ | |||
# FIRST CHECK FOR INDIVIDUAL FILE | |||
################################ | |||
# CR2 FILES | |||
# | |||
# Input file is CR2 or cr2 | |||
if [[ "${INPUT_EXTENSION}" == "CR2" ]] || [[ "${INPUT_EXTENSION}" == "cr2" ]]; then | |||
########### | |||
# Dual ISO - unprocessed CR2 (NOTE: THIS CHECK IS SLOW) | |||
if [[ $(cr2hdr --dry-run "${INPUT}" | grep "Interlaced ISO detected" | wc -l) == 1 ]]; then # Test an input file for Dual ISO. | |||
echo "${INPUT_BASENAME}: Dual ISO CR2 image. Skipping." | |||
IS_SINGLE_CR2=false | |||
else | |||
IS_SINGLE_CR2=true | |||
fi | |||
if [[ $IS_SINGLE_CR2 == true ]]; then | |||
########### | |||
# Single ISO - CR2 | |||
# Subject Tag | |||
# | |||
if [[ $(echo "${SUBJECT}" | sed '/^\s*$/d' | wc -l) == 0 ]]; then | |||
echo "${INPUT_BASENAME}: Add a new Subject tag." | |||
SUBJECT_TAG='Single ISO CR2' | |||
PROCESS_SUBJECT=true | |||
else | |||
echo "${INPUT_BASENAME} is a Single ISO image and has a Subject tag already." | |||
PROCESS_SUBJECT=false | |||
fi | |||
# Baseline Tags | |||
# | |||
if [[ $(echo "${BASELINES}" | sed '/^\s*$/d' | wc -l) == 0 ]]; then | |||
echo "${INPUT_BASENAME}: Add new Baseline tags." | |||
PROCESS_BASELINE=true | |||
else | |||
echo "${INPUT_BASENAME}: Baseline tags exist. Skipping." | |||
PROCESS_BASELINE=false | |||
fi | |||
if [[ $CROPHEIGHT_CHECK_VALUE != $C5DMK3_HEIGHT ]]; then | |||
echo "${INPUT_BASENAME}: New resolution, $C5DMK3_WIDTH x $C5DMK3_HEIGHT." | |||
PROCESS_SIZE=true | |||
else | |||
echo "${INPUT_BASENAME}: Has correct resolution already." | |||
PROCESS_SIZE=false | |||
fi | |||
fi | |||
################################ | |||
# DNG FILES | |||
# | |||
# Input file is DNG or dng | |||
elif [[ "${INPUT_EXTENSION}" == "DNG" ]] || [[ "${INPUT_EXTENSION}" == "dng" ]]; then | |||
########### | |||
# DNG with missing Subject Tag | |||
if [[ $(echo "${SUBJECT}" | sed '/^\s*$/d' | wc -l) == 0 ]]; then | |||
echo "${INPUT_BASENAME}: Add a new Subject tag." | |||
SUBJECT_TAG='Single ISO CR2' | |||
PROCESS_SUBJECT=true | |||
#We don't update size tags. See reason below. | |||
#Baseline tags have already been written by Adobe converter. | |||
PROCESS_SIZE=false | |||
PROCESS_BASELINE=false | |||
########### | |||
# DNG with updated Subject Tag | |||
elif [[ $(echo "${SUBJECT_SINGLEISO}" | sed '/^\s*$/d' | wc -l) != 0 ]]; then | |||
echo "${INPUT_BASENAME}: Subject tag exists. Skipping." | |||
PROCESS_SUBJECT=false | |||
#We don't update size tags. See reason below. | |||
#Baseline tags have already been written by Adobe converter. | |||
PROCESS_SIZE=false | |||
PROCESS_BASELINE=false | |||
########### | |||
# New Dual ISO - DNG | |||
elif [[ $(echo "${SUBJECT_DUALISO}" | sed '/^\s*$/d' | wc -l) != 0 ]]; then | |||
echo "${INPUT_BASENAME}: Dual ISO image with proper tags. Skipping." | |||
# Tags have already be written by updated cr2hdr. | |||
PROCESS_SUBJECT=false | |||
PROCESS_SIZE=false | |||
PROCESS_BASELINE=false | |||
########### | |||
# Old Dual ISO - DNG | |||
elif [[ $(echo "${SUBJECT_DUALISO_OLD}" | sed '/^\s*$/d' | wc -l) != 0 ]]; then | |||
echo "${INPUT_BASENAME}: old Dual ISO image. Update Subject & Baseline tags." | |||
exiftool -xmp:subject= "${INPUT}" -overwrite_original #Clear old tag | |||
PROCESS_SUBJECT=true | |||
SUBJECT_TAG='Dual ISO DNG' | |||
PROCESS_SIZE=false | |||
PROCESS_BASELINE=true #Old dual ISOs don't have this one. | |||
################################ | |||
fi | |||
fi | |||
################################################################ | |||
# Suffix for the new file name | |||
# U = Uncropped (PROCESS_SIZE) | |||
# S = Subject Tag (PROCESS_SUBJECT) | |||
# B = Baseline Tags (PROCESS_BASELINE) | |||
# false, false, false | |||
if [[ $PROCESS_SUBJECT == false ]] && [[ $PROCESS_BASELINE == false ]] && [[ $PROCESS_SIZE == false ]]; then | |||
#WRITENEWFILE=false | |||
SUFFIX= | |||
# true, true, true | |||
elif [[ $PROCESS_SUBJECT == true ]] && [[ $PROCESS_BASELINE == true ]] && [[ $PROCESS_SIZE == true ]]; then | |||
#WRITENEWFILE=true | |||
SUFFIX=_USB | |||
# true, true, false | |||
elif [[ $PROCESS_SUBJECT == true ]] && [[ $PROCESS_BASELINE == true ]] && [[ $PROCESS_SIZE == false ]]; then | |||
#WRITENEWFILE=true | |||
SUFFIX=_SB | |||
# false, true, true | |||
elif [[ $PROCESS_SUBJECT == false ]] && [[ $PROCESS_BASELINE == true ]] && [[ $PROCESS_SIZE == true ]]; then | |||
#WRITENEWFILE=true | |||
SUFFIX=_UB | |||
# true, false, true | |||
elif [[ $PROCESS_SUBJECT == true ]] && [[ $PROCESS_BASELINE == false ]] && [[ $PROCESS_SIZE == true ]]; then | |||
#WRITENEWFILE=true | |||
SUFFIX=_US | |||
# false, true, false | |||
elif [[ $PROCESS_SUBJECT == false ]] && [[ $PROCESS_BASELINE == true ]] && [[ $PROCESS_SIZE == false ]]; then | |||
#WRITENEWFILE=true | |||
SUFFIX=_B | |||
# true, false, false | |||
elif [[ $PROCESS_SUBJECT == true ]] && [[ $PROCESS_BASELINE == false ]] && [[ $PROCESS_SIZE == false ]]; then | |||
#WRITENEWFILE=true | |||
SUFFIX=_S | |||
# false, false, true | |||
elif [[ $PROCESS_SUBJECT == false ]] && [[ $PROCESS_BASELINE == false ]] && [[ $PROCESS_SIZE == true ]]; then | |||
#WRITENEWFILE=true | |||
SUFFIX=_U | |||
fi | |||
################################################################ | |||
# RESOLUTION TAGS MANIPULATION - non-Dual ISO CR2 only | |||
# 1) Check if Size process variable is true | |||
# 2) If question "Do we have a 5D Mark string in the file?" does not return 0, E.G. the camera model is 5D Mark 3... | |||
# And if all previous checks pass, then we do our tricks here. | |||
if [[ $PROCESS_SIZE == true ]] && [[ $C5DMK3_CHECK != 0 ]]; then | |||
# According to file analysis done with CR2 and DNG files, Cropped & Exif Width/Height tags should be written in a CR2 files. | |||
# CR2 files require only Cropped Image Height/Width values, but if we convert an uncropped CR2 file into DNG, we get wrong picture size. | |||
# To correct this for DNG files, Exif Height/Witdh values are required, too. | |||
# WHY WE DON'T CHANGE EXIF TAGS FOR DNG FILES HERE? | |||
# We can't uncrop DNG file procuded by Adobe algorithms (Adobe DNG Converter or raw2dng). This is because Adobe's method writes a tag named | |||
#"Default Crop Size" which can't be changed afterwards without rendering the image unusable in Adobe Camera Raw software. I assume Camera Raw | |||
# does some comparison check between dimensions defined in "Default Crop Size" and some of the exif-unwritable Width/Height values, and if | |||
# there's a mismatch, the file can't be opened in Adobe Camera Raw software. I tested it so an image that can't be opened in ACR, is still | |||
# usable in some other RAW processing software (because their check for EXIF value tags differ). | |||
# Every time I edited "Default Crop Size" value in DNG, ACR gave me an error claiming the file is unsupported or corrupted. | |||
exiftool -CroppedImageWidth=$C5DMK3_WIDTH -CroppedImageHeight=$C5DMK3_HEIGHT -ExifImageWidth=$C5DMK3_WIDTH -ExifImageHeight=$C5DMK3_HEIGHT "${INPUT}" -overwrite_original | |||
echo -e "${INPUT_BASENAME}: Image dimensions updated to $C5DMK3_WIDTH x $C5DMK3_HEIGHT.\n" | |||
# Other useful Height/Width tags are as follows: | |||
# -OriginalImageWidth | |||
# -OriginalImageHeight | |||
# -RelatedImageWidth | |||
# -RelatedImageHeight | |||
fi | |||
################################################################ | |||
# BASELINE TAGS ADDITION - non-Dual ISO CR2 only | |||
# 1) We can request that PROCESS variable returns true though it's set to false in Dual ISO CR2 images too. These CR2 images have Baseline values | |||
# already added into EXIF metadata since 01/07/2017 (cr2hdr code patched). | |||
# 2) We check for Canon 5D Mark 3 here | |||
# NOTE: We don't care about the image resolution here. | |||
if [[ $PROCESS_BASELINE == true ]] && [[ $C5DMK3_CHECK != 0 ]]; then | |||
# The following tags (with their respective values) are being used in DNG files converted from CR2 files of Canon 5D Mark 3 camera. Because CR2 files are mostly equal to | |||
# DNG files but these tags don't exist inside CR2 files, we can add them as done in the following lines. | |||
# ###################################################### | |||
# | |||
# Camera Model: Canon EOS 5D Mark III | |||
# ISO Value Baseline Exposure Value | |||
# | |||
# 100 0.25 | |||
# 125 0.25 | |||
# 200 0.25 | |||
# 250 0.25 | |||
# 400 0.25 | |||
# 500 0.25 | |||
# 800 0.25 | |||
# 1000 0.25 | |||
# 1600 0.25 | |||
# 2000 0.25 | |||
# 3200 0.25 | |||
# 4000 0.25 | |||
# 6400 0.25 | |||
# 8000 0.25 | |||
# 12800 0.25 | |||
# 16000 0.25 | |||
# 25600 0.25 | |||
# | |||
# 50 -0.75 | |||
# 160 0.02 | |||
# 320 0.01 | |||
# 640 0.01 | |||
# 1250 0.01 | |||
# 2500 0.01 | |||
# 5000 0.01 | |||
# 10000 0.01 | |||
# 20000 0.01 | |||
# 51200 0.36 | |||
# 102400 0.36 | |||
# | |||
# ###################################################### | |||
# | |||
# Same values for all ISOs: | |||
# | |||
# Baseline Noise 0.8 | |||
# Baseline Sharpness 1.2 | |||
# Bayer Green Split 100 | |||
# | |||
# ###################################################### | |||
# | |||
# Camera Profiles in Adobe Camera RAW - Baseline Exposure Offsets: | |||
# | |||
# All Canon EOS 5D Mark 3 profiles (Standard, Neutral, Landscape etc.): -0.25 | |||
# Adobe Standard Profile: 0.00 | |||
# | |||
# ###################################################### | |||
# We Do ISO check with Exposure Index value (It returns the same value than used ISO, and works with ISO 102400, too) | |||
if [[ $ISO_VALUE == 50 ]]; then | |||
BL_EXP=-0.75 | |||
elif [[ $ISO_VALUE == 160 ]]; then | |||
BL_EXP=0.02 | |||
elif [[ $ISO_VALUE == 51200 ]] || [[ $ISO_VALUE == 102400 ]]; then | |||
BL_EXP=0.36 | |||
elif [[ $ISO_VALUE == 320 ]] || [[ $ISO_VALUE == 640 ]] || [[ $ISO_VALUE == 1250 ]] || [[ $ISO_VALUE == 2500 ]] || [[ $ISO_VALUE == 5000 ]] || [[ $ISO_VALUE == 10000 ]] || [[ $ISO_VALUE == 20000 ]]; then | |||
BL_EXP=0.01 | |||
else | |||
BL_EXP=0.25 | |||
fi | |||
exiftool -BaselineExposure=$BL_EXP -BaselineNoise=0.8 -BaselineSharpness=1.2 -BayerGreenSplit=100 "${INPUT}" -overwrite_original | |||
echo -e "${INPUT_BASENAME}: Baseline tags added.\n" | |||
fi | |||
# ###################################################### | |||
################################################################ | |||
# SUBJECT TAG ADDITION | |||
if [[ $PROCESS_SUBJECT == true ]] && [[ $C5DMK3_CHECK != 0 ]]; then | |||
exiftool -xmp:subject="$SUBJECT_TAG" "${INPUT}" -overwrite_original | |||
echo -e "${INPUT_BASENAME}: New Subject tag added: $SUBJECT_TAG\n" | |||
fi | |||
################################################################ | |||
# FILE SUFFIX ADDITION | |||
#if [[ $WRITENEWFILE == true ]]; then | |||
exiftool "-FileModifyDate<EXIF:DateTimeOriginal" "${INPUT}" #For individual images and commands, use -P parameter | |||
NEWFILE="${INPUT_DIR}"/"${INPUT_BASENAME}"$SUFFIX."${INPUT_EXTENSION}" | |||
mv "${INPUT}" "${NEWFILE}" | |||
exiftool '-FileName<DateTimeOriginal' -d '%Y%m%d-%f%%-c.%%e' "${NEWFILE}" | |||
#fi | |||
if [[ "${2}" != "" ]]; then | |||
echo "Moving to the next file." | |||
fi | |||
################################################################ | |||
####PROGRESSBAR STUFF - BEGIN | |||
let inc++ | |||
#Percentage needs to be calculated like this due to bash rounding limitations... | |||
PERCENT_VALUE=$((($mltp*$tics)/(200*$numargs/$inc % 2 + $mltp*$numargs/$inc))) | |||
#Output: 20, 40, 59, 80, 100 etc. | |||
qdbus $dbusRef Set "" "value" $PERCENT_VALUE; | |||
qdbus $dbusRef setLabelText "$LABELTEXT ($inc/$numargs)"; | |||
####PROGRESSBAR STUFF - END | |||
shift # Move to the next file | |||
done | |||
############################################## | |||
#Close processing window if cancelled event has been triggered. | |||
####PROGRESSBAR STUFF - BEGIN | |||
# If the process was cancelled, remove tmp file and exit the script. | |||
if [[ ! $(qdbus $dbusRef wasCancelled) == "false" ]]; then | |||
exit | |||
fi | |||
############################################## | |||
#Close processing window if not cancelled and processing finished. | |||
qdbus $dbusRef close | |||
####PROGRESSBAR STUFF - END | |||
exit | |||
############################################## | |||
################################################################################################ | |||
# DEPRECATED | |||
# | |||
# ##while [ $# -gt 0 ]; do | |||
# CROPPED=$1 | |||
# EXTENSION=$(echo $1 | rev | cut -f 1 -d '.' | rev) #Get the correct file extension for an input file (so the new one will use the same) | |||
# UNCROPPED=$(echo "$CROPPED" | sed "s/\.\w*$/_uncropped.$EXTENSION/") | |||
# | |||
# #Is the uncropping already done for a file? If yes, we skip this step. This passes only if file doesn't exist. | |||
# if [[ ! -e $INPUT_DIR/uncropped/$UNCROPPED ]]; then | |||
# | |||
# if [[ $(cr2hdr --dry-run $CROPPED | grep "Interlaced ISO detected" | wc -l) == 1 ]] || [[ $(exiftool $CROPPED |grep "Dual-ISO" | wc -l) != 0 ]] ; then # Test an input file for Dual ISO. | |||
# return 1; #Do not edit Exif data of a Dual ISO file. | |||
# else | |||
# exifres_5dmk3 | |||
# mv $UNCROPPED $INPUT_DIR/uncropped/ | |||
# fi | |||
# fi | |||
# | |||
# ####PROGRESSBAR STUFF - BEGIN | |||
# let inc++ | |||
# | |||
# #Percentage needs to be calculated like this due to bash rounding limitations... | |||
# PERCENT_VALUE=$((($mltp*$tics)/(200*$numargs/$inc % 2 + $mltp*$numargs/$inc))) | |||
# #Output: 20, 40, 59, 80, 100 etc. | |||
# | |||
# qdbus $dbusRef Set "" "value" $PERCENT_VALUE; | |||
# qdbus $dbusRef setLabelText "$LABELTEXT ($inc/$numargs)"; | |||
# ####PROGRESSBAR STUFF - END | |||
# | |||
# shift | |||
# done | |||
# | |||
####PROGRESSBAR STUFF - BEGIN | |||
#$(qdbus $dbusRef wasCancelled) = "true" | |||
#qdbus $dbusRef close | |||
#done | |||
####PROGRESSBAR STUFF - END | |||
# | |||
#Delete empty dir, if no files have been generated | |||
#if [[ $(ls $INPUT_DIR/uncropped/ | wc -l) == 0 ]]; then | |||
# rm -Rf $INPUT_DIR/uncropped/ | |||
#fi | |||
# | |||
# DEPRECATED |
@ -0,0 +1,34 @@ | |||
#!/bin/bash | |||
# Extract DNG frames from Magic Lantern MLV files (KDE/Plasma DE) | |||
# Copyright (C) 2017 Pekka Helenius | |||
# | |||
# This program is free software; you can redistribute it and/or | |||
# modify it under the terms of the GNU General Public License | |||
# as published by the Free Software Foundation; either version 2 | |||
# of the License, or (at your option) any later version. | |||
# | |||
# This program is distributed in the hope that it will be useful, | |||
# but WITHOUT ANY WARRANTY; without even the implied warranty of | |||
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the | |||
# GNU General Public License for more details. | |||
# | |||
# You should have received a copy of the GNU General Public License | |||
# along with this program; if not, write to the Free Software | |||
# Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. | |||
# | |||
############################################### | |||
#We get the directory just from the first filename. Pwd should be easier, but bugged, so... | |||
INPUT_DIR=$(dirname $1) | |||
mkdir -p $INPUT_DIR/mlv_export | |||
while [ $# -gt 0 ]; do | |||
MLV=$1 | |||
mlv_dump --dng $MLV -o ${MLV}_ | |||
mv ????????.MLV_??????.dng $INPUT_DIR/mlv_export | |||
shift | |||
done | |||
kdialog --msgbox "MLV extracted successfully" --title "MLV Extraction"; |
@ -0,0 +1,22 @@ | |||
#!/bin/bash | |||
# Show MLV file info in kdialog window (KDE/Plasma DE) | |||
# Copyright (C) 2017 Pekka Helenius | |||
# | |||
# This program is free software; you can redistribute it and/or | |||
# modify it under the terms of the GNU General Public License | |||
# as published by the Free Software Foundation; either version 2 | |||
# of the License, or (at your option) any later version. | |||
# | |||
# This program is distributed in the hope that it will be useful, | |||
# but WITHOUT ANY WARRANTY; without even the implied warranty of | |||
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the | |||
# GNU General Public License for more details. | |||
# | |||
# You should have received a copy of the GNU General Public License | |||
# along with this program; if not, write to the Free Software | |||
# Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. | |||
# | |||
############################################### | |||
kdialog --msgbox "$(mlv_dump $1 2>&1 | grep -E 'opened|frames' | awk '{print $2}' | sed 's/.*\///' | sed -e '1 i\Files:' -e '4 i\\nDNG Frames:' )" --title "MLV Information"; |
@ -0,0 +1,44 @@ | |||
#!/bin/bash | |||
# Delete all exif metadata from selected images with Exiftool | |||
# Copyright (C) 2017 Pekka Helenius | |||
# | |||
# This program is free software; you can redistribute it and/or | |||
# modify it under the terms of the GNU General Public License | |||
# as published by the Free Software Foundation; either version 2 | |||
# of the License, or (at your option) any later version. | |||
# | |||
# This program is distributed in the hope that it will be useful, | |||
# but WITHOUT ANY WARRANTY; without even the implied warranty of | |||
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the | |||
# GNU General Public License for more details. | |||
# | |||
# You should have received a copy of the GNU General Public License | |||
# along with this program; if not, write to the Free Software | |||
# Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. | |||
# | |||
############################################### | |||
#We get the directory just from the first filename. Pwd should be easier, but bugged, so... | |||
INPUT_DIR=$(dirname $1) | |||
mkdir -p $INPUT_DIR/nometadata | |||
#kdialog --yesnocancel "Do you really want to delete EXIF data for the selection?"; | |||
#if [ "$?" = 0 ]; then | |||
while [ $# -gt 0 ]; do | |||
EXTENSION=$(echo $1 | rev | cut -f 1 -d '.' | rev) #Get the correct file extension for an input file (so the new one will use the same) | |||
OLDFILE=$(basename $1 | sed "s/\.\w*$/.$EXTENSION/") | |||
NEWFILE=$(basename "$OLDFILE" | sed "s/\.\w*$/_nometadata.$EXTENSION/") | |||
exiftool -all= $INPUT_DIR/$OLDFILE -o $INPUT_DIR/nometadata/$NEWFILE | |||
shift | |||
done | |||
#Delete empty metadata folder (if it is) | |||
if [[ $(ls $INPUT_DIR/nometadata/ | wc -l) == 0 ]]; then | |||
rm -Rf $INPUT_DIR/nometadata/ | |||
fi |
@ -0,0 +1,40 @@ | |||
#!/bin/bash | |||
# Delete critical metadata from an image or images using Exiftool | |||
# Copyright (C) 2017 Pekka Helenius | |||
# | |||
# This program is free software; you can redistribute it and/or | |||
# modify it under the terms of the GNU General Public License | |||
# as published by the Free Software Foundation; either version 2 | |||
# of the License, or (at your option) any later version. | |||
# | |||
# This program is distributed in the hope that it will be useful, | |||
# but WITHOUT ANY WARRANTY; without even the implied warranty of | |||
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the | |||
# GNU General Public License for more details. | |||
# | |||
# You should have received a copy of the GNU General Public License | |||
# along with this program; if not, write to the Free Software | |||
# Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. | |||
# | |||
############################################### | |||
#We get the directory just from the first filename. Pwd should be easier, but bugged, so... | |||
INPUT_DIR=$(dirname $1) | |||
#kdialog --yesnocancel "Do you really want to delete EXIF data for the selection?"; | |||
#if [ "$?" = 0 ]; then | |||
while [ $# -gt 0 ]; do | |||
EXTENSION=$(echo $1 | rev | cut -f 1 -d '.' | rev) #Get the correct file extension for an input file (so the new one will use the same) | |||
FILE=$(basename $1 | sed "s/\.\w*$/.$EXTENSION/") | |||
exiftool -xmp:subject= -Software= -Version= -creatortool= -historysoftwareagent= -PhotoshopThumbnail= -FocalLength= -Lens= -FNumber= -ApertureValue= -LensInfo= -LensModel= -ExposureTime= -MaxApertureValue= -SerialNumber= -Make= -ExposureMode= -WhiteBalance= -Flash= -MeteringMode= -ExposureCompensation= -ShutterSpeedValue= -RecommendedExposureIndex= -SensitivityType= -LensSerialNumber= -FocalPlaneYResolution= -FocalPlaneXResolution= -FocalPlaneResolutionUnit= -XResolution= -YResolution= -ResolutionUnit= -iso= -ColorSpace= -Model= -ExposureProgram= -adobe:all= -xmp:all= -photoshop:all= $INPUT_DIR/$FILE -overwrite_original | |||
shift | |||
done | |||
# kdialog --msgbox "Exif metadata deleted!" | |||
#else | |||
# exit 0 | |||
#fi |
@ -0,0 +1,33 @@ | |||
#!/bin/bash | |||
# Stack TIFF images with Anti-Lamenessing Engine (ALE) | |||
# Copyright (C) 2017 Pekka Helenius | |||
# | |||
# This program is free software; you can redistribute it and/or | |||
# modify it under the terms of the GNU General Public License | |||
# as published by the Free Software Foundation; either version 2 | |||
# of the License, or (at your option) any later version. | |||
# | |||
# This program is distributed in the hope that it will be useful, | |||
# but WITHOUT ANY WARRANTY; without even the implied warranty of | |||
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the | |||
# GNU General Public License for more details. | |||
# | |||
# You should have received a copy of the GNU General Public License | |||
# along with this program; if not, write to the Free Software | |||
# Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. | |||
# | |||
############################################### | |||
#We get the directory just from the first filename. Pwd should be easier, but bugged, so... | |||
INPUT_DIR=$(dirname $1) | |||
#First & Last file names (without suffixes) | |||
for last; do true; done | |||
FIRST=$(basename $1 | cut -f 1 -d '.' | sed 's/IMG_//g') #Name of the first file passed into the script | |||
LAST=$(basename $last | cut -f 1 -d '.' | sed 's/IMG_//g') #Name of the last file passed into the script | |||
echo 'Starting image stacking process using temporary TIFF files.' && \ | |||
ale ./temp_tiff/*.tiff output.tif |
@ -0,0 +1,84 @@ | |||
#!/bin/bash | |||
# Geotag images | |||
# Copyright (C) 2017 Pekka Helenius | |||
# | |||
# This program is free software; you can redistribute it and/or | |||
# modify it under the terms of the GNU General Public License | |||
# as published by the Free Software Foundation; either version 2 | |||
# of the License, or (at your option) any later version. | |||
# | |||
# This program is distributed in the hope that it will be useful, | |||
# but WITHOUT ANY WARRANTY; without even the implied warranty of | |||
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the | |||
# GNU General Public License for more details. | |||
# | |||
# You should have received a copy of the GNU General Public License | |||
# along with this program; if not, write to the Free Software | |||
# Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. | |||
# | |||
############################################### | |||
# TODO Coordinate threshold = Grid size is 30x30m? | |||
# TODO Find API for ASTER DEM v2 (better data) | |||
USERNAME=Fincer #For API (data request) | |||
############################ | |||
INTERNET_TEST=$(ping -c 3 nominatim.openstreetmap.org 2>&1 | grep -c "unknown host") #Ping Github three times and look for string 'unknown host' | |||
if [[ ! $INTERNET_TEST -eq 0 ]]; then #If 'unknown host' string is found, then | |||
echo -e "\nCan't connect to geoservice provider (Nominatim). Please check your internet connection and try again.\n" | |||
exit 1 | |||
fi | |||
############################ | |||
for IMAGE in $(echo "${@}"); do | |||
IMAGE_BASENAME=$(basename "${IMAGE}" | cut -f 1 -d '.') | |||
IMAGE_EXTENSION=$(echo $(basename "${IMAGE}" | cut -f 2 -d '.' | sed '/^\s*$/d')) | |||
if [[ $(exiftool -n -p '$GPSLatitude,$GPSLongitude' "${IMAGE}" | awk -F ',' '{print NF}') != 2 ]]; then | |||
echo -e "$IMAGE_BASENAME: Missing coordinates. Are you sure you have geotagged the photo?\n" | |||
exit | |||
else | |||
LATITUDE=$(exiftool -n -p '$GPSLatitude' "${IMAGE}") | |||
LONGITUDE=$(exiftool -n -p '$GPSLongitude' "${IMAGE}") | |||
# Clear previous geonames information | |||
exiftool -Location= -LocationShownCity= -LocationShownCountryName= -LocationShownProvinceState= -LocationShownSublocation= -Country-PrimaryLocationName= -Sub-location= -Country= -City= -State= -Province-State= -GPSAltitude= "${IMAGE}" -overwrite_original | |||
#if [[ $(exiftool -p '$Country-PrimaryLocationName' "${IMAGE}" | awk '{print NF}') != 1 ]]; then | |||
echo -e "$IMAGE_BASENAME: retrieving country information.\n" | |||
reversegeo "${IMAGE}" | |||
#fi | |||
# Reference: http://www.geonames.org/export/web-services.html | |||
# Get elevation by retrieving a ASTER DEM value from GeoNames API server, grid size 30x30m | |||
# There are several error factors: | |||
# DEM Grid size | |||
# General inaccurancies in DEM model | |||
# Geoid model & projection errors | |||
# Coordinate errors | |||
# Variations in (estimated) height values | |||
# So the retrieved elevation value is just a rough estimation here | |||
ALTITUDE=$(curl -s "http://api.geonames.org/astergdem?lat=$LATITUDE&lng=$LONGITUDE&username=$USERNAME") | |||
# IF successful answer, then | |||
if [[ $ALTITUDE =~ '^[0-9]+$' ]]; then | |||
exiftool -GPSAltitude=$ALTITUDE "${IMAGE}" -overwrite_original | |||
echo -e "$IMAGE_BASENAME: Altitude value updated.\n" | |||
else | |||
# TODO IF NOT successful, try again for 2 times, then abort | |||
echo -e "$IMAGE_BASENAME: Couldn't retrieve altitude value.\n" | |||
done |
@ -0,0 +1,339 @@ | |||
GNU GENERAL PUBLIC LICENSE | |||
Version 2, June 1991 | |||
Copyright (C) 1989, 1991 Free Software Foundation, Inc., | |||
51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA | |||
Everyone is permitted to copy and distribute verbatim copies | |||
of this license document, but changing it is not allowed. | |||
Preamble | |||
The licenses for most software are designed to take away your | |||
freedom to share and change it. By contrast, the GNU General Public | |||
License is intended to guarantee your freedom to share and change free | |||
software--to make sure the software is free for all its users. This | |||
General Public License applies to most of the Free Software | |||
Foundation's software and to any other program whose authors commit to | |||
using it. (Some other Free Software Foundation software is covered by | |||
the GNU Lesser General Public License instead.) You can apply it to | |||
your programs, too. | |||
When we speak of free software, we are referring to freedom, not | |||
price. Our General Public Licenses are designed to make sure that you | |||
have the freedom to distribute copies of free software (and charge for | |||
this service if you wish), that you receive source code or can get it | |||
if you want it, that you can change the software or use pieces of it | |||
in new free programs; and that you know you can do these things. | |||
To protect your rights, we need to make restrictions that forbid | |||
anyone to deny you these rights or to ask you to surrender the rights. | |||
These restrictions translate to certain responsibilities for you if you | |||
distribute copies of the software, or if you modify it. | |||
For example, if you distribute copies of such a program, whether | |||
gratis or for a fee, you must give the recipients all the rights that | |||
you have. You must make sure that they, too, receive or can get the | |||
source code. And you must show them these terms so they know their | |||
rights. | |||
We protect your rights with two steps: (1) copyright the software, and | |||
(2) offer you this license which gives you legal permission to copy, | |||
distribute and/or modify the software. | |||
Also, for each author's protection and ours, we want to make certain | |||
that everyone understands that there is no warranty for this free | |||
software. If the software is modified by someone else and passed on, we | |||
want its recipients to know that what they have is not the original, so | |||
that any problems introduced by others will not reflect on the original | |||
authors' reputations. | |||
Finally, any free program is threatened constantly by software | |||
patents. We wish to avoid the danger that redistributors of a free | |||
program will individually obtain patent licenses, in effect making the | |||
program proprietary. To prevent this, we have made it clear that any | |||
patent must be licensed for everyone's free use or not licensed at all. | |||
The precise terms and conditions for copying, distribution and | |||
modification follow. | |||
GNU GENERAL PUBLIC LICENSE | |||
TERMS AND CONDITIONS FOR COPYING, DISTRIBUTION AND MODIFICATION | |||
0. This License applies to any program or other work which contains | |||
a notice placed by the copyright holder saying it may be distributed | |||
under the terms of this General Public License. The "Program", below, | |||
refers to any such program or work, and a "work based on the Program" | |||
means either the Program or any derivative work under copyright law: | |||
that is to say, a work containing the Program or a portion of it, | |||
either verbatim or with modifications and/or translated into another | |||
language. (Hereinafter, translation is included without limitation in | |||
the term "modification".) Each licensee is addressed as "you". | |||
Activities other than copying, distribution and modification are not | |||
covered by this License; they are outside its scope. The act of | |||
running the Program is not restricted, and the output from the Program | |||
is covered only if its contents constitute a work based on the | |||
Program (independent of having been made by running the Program). | |||
Whether that is true depends on what the Program does. | |||
1. You may copy and distribute verbatim copies of the Program's | |||
source code as you receive it, in any medium, provided that you | |||
conspicuously and appropriately publish on each copy an appropriate | |||
copyright notice and disclaimer of warranty; keep intact all the | |||
notices that refer to this License and to the absence of any warranty; | |||
and give any other recipients of the Program a copy of this License | |||
along with the Program. | |||
You may charge a fee for the physical act of transferring a copy, and | |||
you may at your option offer warranty protection in exchange for a fee. | |||
2. You may modify your copy or copies of the Program or any portion | |||
of it, thus forming a work based on the Program, and copy and | |||
distribute such modifications or work under the terms of Section 1 | |||
above, provided that you also meet all of these conditions: | |||
a) You must cause the modified files to carry prominent notices | |||
stating that you changed the files and the date of any change. | |||
b) You must cause any work that you distribute or publish, that in | |||
whole or in part contains or is derived from the Program or any | |||
part thereof, to be licensed as a whole at no charge to all third | |||
parties under the terms of this License. | |||
c) If the modified program normally reads commands interactively | |||
when run, you must cause it, when started running for such | |||
interactive use in the most ordinary way, to print or display an | |||
announcement including an appropriate copyright notice and a | |||
notice that there is no warranty (or else, saying that you provide | |||
a warranty) and that users may redistribute the program under | |||
these conditions, and telling the user how to view a copy of this | |||
License. (Exception: if the Program itself is interactive but | |||
does not normally print such an announcement, your work based on | |||
the Program is not required to print an announcement.) | |||
These requirements apply to the modified work as a whole. If | |||
identifiable sections of that work are not derived from the Program, | |||
and can be reasonably considered independent and separate works in | |||
themselves, then this License, and its terms, do not apply to those | |||
sections when you distribute them as separate works. But when you | |||
distribute the same sections as part of a whole which is a work based | |||
on the Program, the distribution of the whole must be on the terms of | |||
this License, whose permissions for other licensees extend to the | |||
entire whole, and thus to each and every part regardless of who wrote it. | |||
Thus, it is not the intent of this section to claim rights or contest | |||
your rights to work written entirely by you; rather, the intent is to | |||
exercise the right to control the distribution of derivative or | |||
collective works based on the Program. | |||
In addition, mere aggregation of another work not based on the Program | |||
with the Program (or with a work based on the Program) on a volume of | |||
a storage or distribution medium does not bring the other work under | |||
the scope of this License. | |||
3. You may copy and distribute the Program (or a work based on it, | |||
under Section 2) in object code or executable form under the terms of | |||
Sections 1 and 2 above provided that you also do one of the following: | |||
a) Accompany it with the complete corresponding machine-readable | |||
source code, which must be distributed under the terms of Sections | |||
1 and 2 above on a medium customarily used for software interchange; or, | |||
b) Accompany it with a written offer, valid for at least three | |||
years, to give any third party, for a charge no more than your | |||
cost of physically performing source distribution, a complete | |||
machine-readable copy of the corresponding source code, to be | |||
distributed under the terms of Sections 1 and 2 above on a medium | |||
customarily used for software interchange; or, | |||
c) Accompany it with the information you received as to the offer | |||
to distribute corresponding source code. (This alternative is | |||
allowed only for noncommercial distribution and only if you | |||
received the program in object code or executable form with such | |||
an offer, in accord with Subsection b above.) | |||
The source code for a work means the preferred form of the work for | |||
making modifications to it. For an executable work, complete source | |||
code means all the source code for all modules it contains, plus any | |||
associated interface definition files, plus the scripts used to | |||
control compilation and installation of the executable. However, as a | |||
special exception, the source code distributed need not include | |||
anything that is normally distributed (in either source or binary | |||
form) with the major components (compiler, kernel, and so on) of the | |||
operating system on which the executable runs, unless that component | |||
itself accompanies the executable. | |||
If distribution of executable or object code is made by offering | |||
access to copy from a designated place, then offering equivalent | |||
access to copy the source code from the same place counts as | |||
distribution of the source code, even though third parties are not | |||
compelled to copy the source along with the object code. | |||
4. You may not copy, modify, sublicense, or distribute the Program | |||
except as expressly provided under this License. Any attempt | |||
otherwise to copy, modify, sublicense or distribute the Program is | |||
void, and will automatically terminate your rights under this License. | |||
However, parties who have received copies, or rights, from you under | |||
this License will not have their licenses terminated so long as such | |||
parties remain in full compliance. | |||
5. You are not required to accept this License, since you have not | |||
signed it. However, nothing else grants you permission to modify or | |||
distribute the Program or its derivative works. These actions are | |||
prohibited by law if you do not accept this License. Therefore, by | |||
modifying or distributing the Program (or any work based on the | |||
Program), you indicate your acceptance of this License to do so, and | |||
all its terms and conditions for copying, distributing or modifying | |||
the Program or works based on it. | |||
6. Each time you redistribute the Program (or any work based on the | |||
Program), the recipient automatically receives a license from the | |||
original licensor to copy, distribute or modify the Program subject to | |||
these terms and conditions. You may not impose any further | |||
restrictions on the recipients' exercise of the rights granted herein. | |||
You are not responsible for enforcing compliance by third parties to | |||
this License. | |||
7. If, as a consequence of a court judgment or allegation of patent | |||
infringement or for any other reason (not limited to patent issues), | |||
conditions are imposed on you (whether by court order, agreement or | |||
otherwise) that contradict the conditions of this License, they do not | |||
excuse you from the conditions of this License. If you cannot | |||
distribute so as to satisfy simultaneously your obligations under this | |||
License and any other pertinent obligations, then as a consequence you | |||
may not distribute the Program at all. For example, if a patent | |||
license would not permit royalty-free redistribution of the Program by | |||
all those who receive copies directly or indirectly through you, then | |||
the only way you could satisfy both it and this License would be to | |||
refrain entirely from distribution of the Program. | |||
If any portion of this section is held invalid or unenforceable under | |||
any particular circumstance, the balance of the section is intended to | |||
apply and the section as a whole is intended to apply in other | |||
circumstances. | |||
It is not the purpose of this section to induce you to infringe any | |||
patents or other property right claims or to contest validity of any | |||
such claims; this section has the sole purpose of protecting the | |||
integrity of the free software distribution system, which is | |||
implemented by public license practices. Many people have made | |||
generous contributions to the wide range of software distributed | |||
through that system in reliance on consistent application of that | |||
system; it is up to the author/donor to decide if he or she is willing | |||
to distribute software through any other system and a licensee cannot | |||
impose that choice. | |||
This section is intended to make thoroughly clear what is believed to | |||
be a consequence of the rest of this License. | |||
8. If the distribution and/or use of the Program is restricted in | |||
certain countries either by patents or by copyrighted interfaces, the | |||
original copyright holder who places the Program under this License | |||
may add an explicit geographical distribution limitation excluding | |||
those countries, so that distribution is permitted only in or among | |||
countries not thus excluded. In such case, this License incorporates | |||
the limitation as if written in the body of this License. | |||
9. The Free Software Foundation may publish revised and/or new versions | |||
of the General Public License from time to time. Such new versions will | |||
be similar in spirit to the present version, but may differ in detail to | |||
address new problems or concerns. | |||
Each version is given a distinguishing version number. If the Program | |||
specifies a version number of this License which applies to it and "any | |||
later version", you have the option of following the terms and conditions | |||
either of that version or of any later version published by the Free | |||
Software Foundation. If the Program does not specify a version number of | |||
this License, you may choose any version ever published by the Free Software | |||
Foundation. | |||
10. If you wish to incorporate parts of the Program into other free | |||
programs whose distribution conditions are different, write to the author | |||
to ask for permission. For software which is copyrighted by the Free | |||
Software Foundation, write to the Free Software Foundation; we sometimes | |||
make exceptions for this. Our decision will be guided by the two goals | |||
of preserving the free status of all derivatives of our free software and | |||
of promoting the sharing and reuse of software generally. | |||
NO WARRANTY | |||
11. BECAUSE THE PROGRAM IS LICENSED FREE OF CHARGE, THERE IS NO WARRANTY | |||
FOR THE PROGRAM, TO THE EXTENT PERMITTED BY APPLICABLE LAW. EXCEPT WHEN | |||
OTHERWISE STATED IN WRITING THE COPYRIGHT HOLDERS AND/OR OTHER PARTIES | |||
PROVIDE THE PROGRAM "AS IS" WITHOUT WARRANTY OF ANY KIND, EITHER EXPRESSED | |||
OR IMPLIED, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF | |||
MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE. THE ENTIRE RISK AS | |||
TO THE QUALITY AND PERFORMANCE OF THE PROGRAM IS WITH YOU. SHOULD THE | |||
PROGRAM PROVE DEFECTIVE, YOU ASSUME THE COST OF ALL NECESSARY SERVICING, | |||
REPAIR OR CORRECTION. | |||
12. IN NO EVENT UNLESS REQUIRED BY APPLICABLE LAW OR AGREED TO IN WRITING | |||
WILL ANY COPYRIGHT HOLDER, OR ANY OTHER PARTY WHO MAY MODIFY AND/OR | |||
REDISTRIBUTE THE PROGRAM AS PERMITTED ABOVE, BE LIABLE TO YOU FOR DAMAGES, | |||
INCLUDING ANY GENERAL, SPECIAL, INCIDENTAL OR CONSEQUENTIAL DAMAGES ARISING | |||
OUT OF THE USE OR INABILITY TO USE THE PROGRAM (INCLUDING BUT NOT LIMITED | |||
TO LOSS OF DATA OR DATA BEING RENDERED INACCURATE OR LOSSES SUSTAINED BY | |||
YOU OR THIRD PARTIES OR A FAILURE OF THE PROGRAM TO OPERATE WITH ANY OTHER | |||
PROGRAMS), EVEN IF SUCH HOLDER OR OTHER PARTY HAS BEEN ADVISED OF THE | |||
POSSIBILITY OF SUCH DAMAGES. | |||
END OF TERMS AND CONDITIONS | |||
How to Apply These Terms to Your New Programs | |||
If you develop a new program, and you want it to be of the greatest | |||
possible use to the public, the best way to achieve this is to make it | |||
free software which everyone can redistribute and change under these terms. | |||
To do so, attach the following notices to the program. It is safest | |||
to attach them to the start of each source file to most effectively | |||
convey the exclusion of warranty; and each file should have at least | |||
the "copyright" line and a pointer to where the full notice is found. | |||
<one line to give the program's name and a brief idea of what it does.> | |||
Copyright (C) <year> <name of author> | |||
This program is free software; you can redistribute it and/or modify | |||
it under the terms of the GNU General Public License as published by | |||
the Free Software Foundation; either version 2 of the License, or | |||
(at your option) any later version. | |||
This program is distributed in the hope that it will be useful, | |||
but WITHOUT ANY WARRANTY; without even the implied warranty of | |||
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the | |||
GNU General Public License for more details. | |||
You should have received a copy of the GNU General Public License along | |||
with this program; if not, write to the Free Software Foundation, Inc., | |||
51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. | |||
Also add information on how to contact you by electronic and paper mail. | |||
If the program is interactive, make it output a short notice like this | |||
when it starts in an interactive mode: | |||
Gnomovision version 69, Copyright (C) year name of author | |||
Gnomovision comes with ABSOLUTELY NO WARRANTY; for details type `show w'. | |||
This is free software, and you are welcome to redistribute it | |||
under certain conditions; type `show c' for details. | |||
The hypothetical commands `show w' and `show c' should show the appropriate | |||
parts of the General Public License. Of course, the commands you use may | |||
be called something other than `show w' and `show c'; they could even be | |||
mouse-clicks or menu items--whatever suits your program. | |||
You should also get your employer (if you work as a programmer) or your | |||
school, if any, to sign a "copyright disclaimer" for the program, if | |||
necessary. Here is a sample; alter the names: | |||
Yoyodyne, Inc., hereby disclaims all copyright interest in the program | |||
`Gnomovision' (which makes passes at compilers) written by James Hacker. | |||
<signature of Ty Coon>, 1 April 1989 | |||
Ty Coon, President of Vice | |||
This General Public License does not permit incorporating your program into | |||
proprietary programs. If your program is a subroutine library, you may | |||
consider it more useful to permit linking proprietary applications with the | |||
library. If this is what you want to do, use the GNU Lesser General | |||
Public License instead of this License. |
@ -0,0 +1,109 @@ | |||
# Linux camera tools for Canon DSLR owners | |||
- main target group: | |||
- Linux users who own a Canon DSLR camera and may have Magic Lantern firmware on their workflow | |||
- Linux users who own a Canon DSLR camera and are interested in exporting statistics from their CR2 raw images | |||
- ...and others alike | |||
## About | |||
### Camera statistics | |||
- Create image statistics easily with a right-click menu entry in Dolphin file manager. Exports statistics from RAW images and draws various plots based on this data | |||
- Support for following statistics (with GNU Plot): | |||
- Temperatures & ISOs | |||
- **NOTE** GNU Plots are not yet supported for | |||
- Apertures, Exposures & ISOs | |||
- Focal Lengths & Lenses | |||
- Shooting & Focus Modes | |||
- Possible to extract all or selected camera RAW metadata and save it into a CSV file for post-processing. | |||
### Dual ISO conversion | |||
- Convert Magic Lantern dual ISO cr2 files easily with a right-click menu entry in Dolphin file manager. | |||
- Support for individual image and multiple images selection. | |||
- Is able to distinguish single ISO CR2 files from dual ISO CR2 files. You can select multiple CR2 files without need to care about this issue. | |||
- By default, CR2 images contain metadata which crop them in most image viewers. This script removes all cropping tags and you get full-sized images for your post-processing editors as a result. | |||
- Adds `--dry-run` support for cr2hdr. Therefore, the tool can be used just to check whether a CR2 image is a dual ISO image or not. Useful option in scripting & programming. | |||
### Bootable SD Card | |||
- Create a Magic Lantern bootable SD card for your Canon DSLR. Code is released by Magic Lantern project under GPL license. | |||
### MLV info | |||
- Print information about Magic Lantern MLV files on KDE/Plasma desktop environment | |||
### Exiftool - delete critical / all metadata | |||
- Scripts for deleting all or critical (identifiable) metadata from image files. Preferred usage: integrated with Dolphin file manager. | |||
### ALE stack | |||
- Stack multiple non-RAW TIFF images in a directory | |||
## Repository contents | |||
### 0_cr2hdr_tool | |||
Source files for customized cr2hdr tool, required by scripts (statistics, dual ISO conversions...) in this repository. | |||
### 1_magiclantern_bootablecard_linux | |||
Source files for creating an Arch Linux package for Magic Lantern bootable SD card tool. | |||
### 2_gnuplot_patch | |||
Patch file for GNU Plot for better QT integration. Adds and alters some features which benefit generated statistics. Tested with GNU Plot 5.0.6. | |||
### 3_desktop_files_for_kde-plasma-dolphin | |||
Dolphin file manager desktop integration for scripts in this repository. | |||
### 4_scripts | |||
Main scripts for exporting statistics, doing image conversions...etc. | |||
### sample_images | |||
Sample images. | |||
## Screenshots | |||
Temperature & ISO plots for 20 images: | |||
![](sample_images/image_5.png) | |||
Temperature & ISO plots for 2 images: | |||
![](sample_images/image_2.png) | |||
Exported statistics: | |||
![](sample_images/image_1.png) | |||
Dolphin menu entries (KDE/Plasma): | |||
![](sample_images/image_4.png) | |||
Statistics export progress bar (KDE/Plasma): | |||
![](sample_images/image_3.png) | |||
## License | |||
Contents of this repository have been published under GPLv2. |