magazines scripts
This commit is contained in:
parent
c9b25e6672
commit
3d31705696
5
ScanScripts/Windows/magazines/0 - Amiga Format.cmd
Normal file
5
ScanScripts/Windows/magazines/0 - Amiga Format.cmd
Normal file
@ -0,0 +1,5 @@
|
||||
@echo off
|
||||
mkdir output
|
||||
for %%i in (*.tif) DO (
|
||||
convert %%i -quality 85%% output\%%~ni.jpg
|
||||
)
|
@ -0,0 +1,9 @@
|
||||
@echo off
|
||||
mkdir work
|
||||
cd origs
|
||||
for %%i in (*.tif) DO (
|
||||
convert %%i -level 11%%,86%% ..\work\%%i
|
||||
)
|
||||
for %%i in (*.png) DO (
|
||||
convert %%i -level 11%%,86%% ..\work\%%i
|
||||
)
|
@ -0,0 +1,47 @@
|
||||
@echo off
|
||||
setlocal EnableDelayedExpansion
|
||||
set folder=%cd%
|
||||
cd work\out
|
||||
choice /m "Fix paging "
|
||||
if %errorlevel%==1 (
|
||||
copy D:\Retro-Work\correct_pages.php .\ /y
|
||||
php -f correct_pages.php
|
||||
cd newpages
|
||||
)
|
||||
|
||||
if NOT EXIST output mkdir output
|
||||
set thumb=1
|
||||
|
||||
if NOT EXIST audiomedia mkdir audiomedia
|
||||
|
||||
|
||||
for %%i in (*.tif) DO (
|
||||
if !thumb!==1 (
|
||||
convert %%i -resize 240x310^^! -quality 75%% !folder!\thumb.jpg
|
||||
)
|
||||
set thumb=2
|
||||
convert -units pixelsperinch %%i -resample 150 audiomedia\%%~ni.jpg
|
||||
convert %%i -quality 95%% output\%%~ni.jpg
|
||||
)
|
||||
|
||||
rem 300dpi mag
|
||||
cd output
|
||||
for %%i in (*.jpg) DO (
|
||||
convert %%i %%~ni.pdf
|
||||
)
|
||||
|
||||
del *.jpg /q
|
||||
pdftk *.pdf cat output "%folder%\mag.pdf"
|
||||
del *.pdf /q
|
||||
cd ..
|
||||
|
||||
|
||||
rem Tablet
|
||||
cd audiomedia
|
||||
for %%i in (*.jpg) DO (
|
||||
convert %%i %%~ni.pdf
|
||||
)
|
||||
del *.jpg /q
|
||||
pdftk *.pdf output "%folder%\audiomedia.pdf"
|
||||
del *.pdf /q
|
||||
pause
|
44
ScanScripts/Windows/magazines/2 - Make manual-IrfanView.cmd
Normal file
44
ScanScripts/Windows/magazines/2 - Make manual-IrfanView.cmd
Normal file
@ -0,0 +1,44 @@
|
||||
@echo off
|
||||
|
||||
setlocal EnableDelayedExpansion
|
||||
set folder=%cd%
|
||||
cd work\out
|
||||
|
||||
choice /m "Fix paging "
|
||||
if %errorlevel%==1 (
|
||||
copy D:\Retro-Work\correct_pages.php .\ /y
|
||||
php -f correct_pages.php
|
||||
cd newpages
|
||||
)
|
||||
|
||||
choice /C LSN /m "Use large (L), small (S) or no (N) lastpage "
|
||||
if %errorlevel%==1 (
|
||||
set page=brought_to_you_by.pdf
|
||||
) else if %errorlevel%==2 (
|
||||
set page=brought_to_you_by_[TABLET].pdf
|
||||
)
|
||||
|
||||
if NOT EXIST output mkdir output
|
||||
set thumb=1
|
||||
|
||||
for %%i in (*.tif) DO (
|
||||
if !thumb!==1 (
|
||||
convert %%i -resize 240x310^^! -quality 80%% "!folder!\thumb.jpg"
|
||||
)
|
||||
set thumb=2
|
||||
)
|
||||
"c:\Program Files (x86)\IrfanView\i_view32.exe" .\*.tif /convert=.\output\*.pdf
|
||||
|
||||
cd output
|
||||
REM for %%i in (*.jpg) DO (
|
||||
REM convert %%i %%~ni.pdf
|
||||
REM )
|
||||
|
||||
REM del *.jpg /q
|
||||
pdftk *.pdf "D:\Retro-Work\%page%" cat output "%folder%\_manual.pdf"
|
||||
pdftk "%folder%\_manual.pdf" update_info D:\Retro-Work\metadata.txt output "%folder%\manual.pdf"
|
||||
del *.pdf /q
|
||||
REM del ..\*.* /q
|
||||
del "%folder%\_manual.pdf" /q
|
||||
|
||||
pause
|
57
ScanScripts/Windows/magazines/2 - Make normal magazine.cmd
Normal file
57
ScanScripts/Windows/magazines/2 - Make normal magazine.cmd
Normal file
@ -0,0 +1,57 @@
|
||||
@echo off
|
||||
setlocal EnableDelayedExpansion
|
||||
set folder=%cd%
|
||||
cd work\out
|
||||
choice /m "Fix paging "
|
||||
if %errorlevel%==1 (
|
||||
copy D:\Retro-Work\correct_pages.php .\ /y
|
||||
php -f correct_pages.php
|
||||
cd newpages
|
||||
)
|
||||
|
||||
choice /C LSN /m "Use large (L), small (S) or no (N) lastpage "
|
||||
if %errorlevel%==1 (
|
||||
set page=brought_to_you_by.pdf
|
||||
) else if %errorlevel%==2 (
|
||||
set page=brought_to_you_by_[TABLET].pdf
|
||||
)
|
||||
|
||||
if NOT EXIST output mkdir output
|
||||
set thumb=1
|
||||
|
||||
if NOT EXIST tablet mkdir tablet
|
||||
|
||||
|
||||
for %%i in (*.tif) DO (
|
||||
if !thumb!==1 (
|
||||
convert %%i -resize 240x310^^! -quality 75%% "!folder!\thumb.jpg"
|
||||
)
|
||||
set thumb=2
|
||||
convert -units pixelsperinch %%i -resample 150 tablet\%%~ni.jpg
|
||||
convert -units pixelsperinch %%i -resample 300 -quality 95%% output\%%~ni.jpg
|
||||
)
|
||||
|
||||
rem 300dpi mag
|
||||
cd output
|
||||
for %%i in (*.jpg) DO (
|
||||
convert %%i %%~ni.pdf
|
||||
)
|
||||
|
||||
del *.jpg /q
|
||||
pdftk *.pdf D:\Retro-Work\brought_to_you_by.pdf cat output "!folder!\_mag.pdf"
|
||||
pdftk "!folder!\_mag.pdf" update_info D:\Retro-Work\metadata.txt output "!folder!\mag.pdf"
|
||||
del *.pdf /q
|
||||
del "!folder!\_mag.pdf"
|
||||
cd ..
|
||||
|
||||
|
||||
rem Tablet
|
||||
cd tablet
|
||||
for %%i in (*.jpg) DO (
|
||||
convert %%i %%~ni.pdf
|
||||
)
|
||||
del *.jpg /q
|
||||
pdftk *.pdf D:\Retro-Work\brought_to_you_by_[TABLET].pdf cat output _tablet.pdf
|
||||
pdftk _tablet.pdf update_info D:\Retro-Work\metadata.txt output "!folder!\_tablet.pdf"
|
||||
del *.pdf /q
|
||||
pause
|
42
ScanScripts/Windows/magazines/2 - Make tiff magazine.cmd
Normal file
42
ScanScripts/Windows/magazines/2 - Make tiff magazine.cmd
Normal file
@ -0,0 +1,42 @@
|
||||
@echo off
|
||||
|
||||
setlocal EnableDelayedExpansion
|
||||
set folder=%cd%
|
||||
cd work\out
|
||||
|
||||
choice /m "Fix paging "
|
||||
if %errorlevel%==1 (
|
||||
copy D:\Retro-Work\correct_pages.php .\ /y
|
||||
php -f correct_pages.php
|
||||
cd newpages
|
||||
)
|
||||
|
||||
|
||||
if NOT EXIST output mkdir output
|
||||
if NOT EXIST tablet mkdir tablet
|
||||
set thumb=1
|
||||
|
||||
for %%i in (*.tif) DO (
|
||||
if !thumb!==1 (
|
||||
convert %%i -resize 240x310^^! -quality 80%% "!folder!\thumb.jpg"
|
||||
)
|
||||
set thumb=2
|
||||
convert %%i output\%%~ni.pdf
|
||||
convert -units pixelsperinch %%i -resample 150 tablet\%%~ni.pdf
|
||||
)
|
||||
|
||||
cd output
|
||||
pdftk *.pdf "D:\Retro-Work\brought_to_you_by.pdf" cat output "%folder%\_manual.pdf"
|
||||
cd ..\tablet
|
||||
pdftk *.pdf "D:\Retro-Work\brought_to_you_by_[TABLET].pdf" cat output "%folder%\_tablet.pdf"
|
||||
cd ..
|
||||
|
||||
del output\*.pdf /q
|
||||
del tablet\*.pdf /q
|
||||
rd output
|
||||
rd tablet
|
||||
|
||||
cd %folder%
|
||||
start _manual.pdf
|
||||
start _tablet.pdf
|
||||
pause
|
28
ScanScripts/Windows/magazines/3 - PdfToText.cmd
Normal file
28
ScanScripts/Windows/magazines/3 - PdfToText.cmd
Normal file
@ -0,0 +1,28 @@
|
||||
@echo off
|
||||
|
||||
|
||||
pdftotext manual_recognized.pdf manual2.ocr.txt
|
||||
pdftotext _manual_recognized.pdf manual2.ocr.txt
|
||||
pdftotext mag_recognized.pdf manual2.ocr.txt
|
||||
pdftk "manual_recognized.pdf" update_info D:\Retro-Work\metadata.txt output "manual2.pdf"
|
||||
pdftk "_manual_recognized.pdf" update_info D:\Retro-Work\metadata.txt output "manual2.pdf"
|
||||
pdftk "mag_recognized.pdf" update_info D:\Retro-Work\metadata.txt output "[300dpi][ocr].pdf"
|
||||
pdftk "_manual_recognized.pdf" update_info D:\Retro-Work\metadata.txt output "[600dpi][ocr].pdf"
|
||||
pdftk "_tablet_recognized.pdf" update_info D:\Retro-Work\metadata.txt output "[150dpi][ocr].pdf"
|
||||
pdftk "audiomedia_recognized.pdf" update_info D:\Retro-Work\metadata.txt output "Privat_Computer_199x_-_xx.pdf"
|
||||
|
||||
start [600dpi][ocr].pdf
|
||||
start [150dpi][ocr].pdf
|
||||
|
||||
choice /m "Delete old files?"
|
||||
|
||||
if %ERRORLEVEL% EQU 1 goto delete
|
||||
goto end
|
||||
|
||||
:delete
|
||||
del _manual.pdf
|
||||
del _manual_recognized.pdf
|
||||
del _tablet.pdf
|
||||
del _tablet_recognized.pdf
|
||||
|
||||
:end
|
37
ScanScripts/Windows/magazines/5 - hash_em.cmd
Normal file
37
ScanScripts/Windows/magazines/5 - hash_em.cmd
Normal file
@ -0,0 +1,37 @@
|
||||
@echo off
|
||||
|
||||
REM setlocal EnableDelayedExpansion
|
||||
REM for "%%i" in (*_recognized.pdf) DO (
|
||||
REM set file=%%i
|
||||
REM set output=!file:recognized=ocr!
|
||||
REM pdftk "%%i" update_info "D:\Retro-Work\metadata.txt" output !output!
|
||||
REM del "%%i
|
||||
REM )
|
||||
REM endlocal
|
||||
|
||||
|
||||
|
||||
|
||||
for %%i in (*.pdf) DO (
|
||||
md5sum "%%i" > "%%i.md5"
|
||||
sha1sum "%%i" > "%%i.sha1"
|
||||
)
|
||||
|
||||
for %%j in (*.ocr.txt) DO (
|
||||
md5sum "%%j" > "%%j.md5"
|
||||
echo 2
|
||||
sha1sum "%%j" > "%%j.sha1"
|
||||
)
|
||||
|
||||
for %%k in (*.zip) DO (
|
||||
md5sum "%%k" > "%%k.md5"
|
||||
echo 3
|
||||
sha1sum "%%k" > "%%k.sha1"
|
||||
)
|
||||
|
||||
cd work\out
|
||||
rd cache /s /q
|
||||
rd newpages /s /q
|
||||
rd output /s /q
|
||||
|
||||
pause
|
@ -0,0 +1,7 @@
|
||||
@echo off
|
||||
mkdir work
|
||||
mkdir origs
|
||||
for %%i in (*.tif) DO (
|
||||
convert %%i -level 11%%,86%% work\%%i
|
||||
move %%i origs
|
||||
)
|
@ -0,0 +1,7 @@
|
||||
@echo off
|
||||
mkdir audiomedia
|
||||
for %%i in (*.tif) DO (
|
||||
convert -units pixelsperinch %%i -resample 150 audiomedia\%%i
|
||||
)
|
||||
|
||||
|
@ -0,0 +1,5 @@
|
||||
@echo off
|
||||
mkdir tablet
|
||||
for %%i in (*.tif) DO (
|
||||
convert %%i -resize 1024x4096 -quality 85%% tablet\%%~ni.jpg
|
||||
)
|
@ -0,0 +1,11 @@
|
||||
@echo off
|
||||
mkdir out
|
||||
for %%i in (*.tif) DO (
|
||||
convert -units pixelsperinch %%i -resample 150 out\%%i
|
||||
)
|
||||
|
||||
for %%i in (*.png) DO (
|
||||
convert -units pixelsperinch %%i -resample 150 out\%%i
|
||||
)
|
||||
|
||||
|
Binary file not shown.
After Width: | Height: | Size: 4.8 KiB |
@ -0,0 +1,4 @@
|
||||
url: COMPuter_Issue_003_1985-12.pdf
|
||||
title: COMputer 09/89
|
||||
date: 1989 Sep
|
||||
resolution: 0
|
@ -0,0 +1,32 @@
|
||||
Scriptet kræver php.exe samt php.dll (medlagt denne zip fil) for at kunne køres.
|
||||
|
||||
Runme.cmd er en fil man kan dobbelt klikke på så man bliver fri for at skulle skrive
|
||||
kommanoen fra kommando prompten i Windows.
|
||||
|
||||
Scriptet går ud fra at
|
||||
1. siderne har været scannet ved at føde scanneren med papirsiderne fra et blad hvor
|
||||
klipsen har været fjernet, dvs for- bagside er scannet til 1 billede, og papiret vendt om så
|
||||
side 2 og andensidste side er scannet som nr 2 osv. Dette kan gøres fra en almindelig flatbed-
|
||||
scanner eller fra en dokument scanner. Scannes siderne som de læses, fx side 2,3,4,5 skal
|
||||
dette script ikke benyttes.
|
||||
|
||||
2. Inputfilerne har været behandlet ved at skære siderne i 2. fx fra ScanTailor.
|
||||
|
||||
3. For- og bagsiderne er de første sider der er scannet ind, midtersiderne er de sidste.
|
||||
Fx siderne er scannet i dokumentscanneren med forsiden opad.
|
||||
|
||||
[Vejledning]
|
||||
de 4 filer: correct_pages.php, php.dll, php.exe og runme.cmd lægges i mappen
|
||||
med filerne der er i uorden.
|
||||
|
||||
Input filerne skal være med fil extension tif, som outputtes fra Scan Tailor programmet.
|
||||
|
||||
Dobbelt klik på "runme.cmd" filen.
|
||||
Der popper en sort skærm op ved kørsels start, og beder om at trykke en tast når
|
||||
jobbet er færdigt.
|
||||
|
||||
Der ligger nu en kopi -i sorteret rækkefølge- i en undermappe "newpages".
|
||||
|
||||
Der bliver ikke lavet noget ved input/original filerne.
|
||||
|
||||
Filerne fra newpages mappen kan nu kopieres ind i Adobe Acrobat.
|
@ -0,0 +1,65 @@
|
||||
<?php
|
||||
// Author Carsten Jensen aka Tomse
|
||||
// Copyright (c) 2013 Carsten Jensen
|
||||
// Released under GNU GPL v2
|
||||
|
||||
// Corrects page numbers from scanned full-paper pages
|
||||
// which has been split into 2, and been edited in scan tailor
|
||||
|
||||
$ext = '.tif';
|
||||
$files = glob('*.tif');
|
||||
|
||||
// set to 0 if back page lies first, or 1 if frontpage lies first
|
||||
$up = 0;
|
||||
$down = count($files);
|
||||
$dest = 'newpages';
|
||||
$pad = strlen($down)+1;
|
||||
@mkdir($dest);
|
||||
|
||||
$again = 1;
|
||||
$back = true;
|
||||
|
||||
foreach($files as $k => $v)
|
||||
{
|
||||
|
||||
|
||||
if($back === true)
|
||||
{
|
||||
|
||||
copy($v, $dest . DIRECTORY_SEPARATOR . 'page' . padding($down, $pad) . $ext);
|
||||
$down--;
|
||||
if ($again > 2 OR $k == 0)
|
||||
{
|
||||
$again = 1;
|
||||
$back = false;
|
||||
}
|
||||
echo "$k => $down \n";
|
||||
$again++;
|
||||
}
|
||||
else
|
||||
{
|
||||
copy($v, $dest . DIRECTORY_SEPARATOR . 'page' . padding($up, $pad) . $ext);
|
||||
$up++;
|
||||
if ($again > 2)
|
||||
{
|
||||
$again = 1;
|
||||
$back = true;
|
||||
}
|
||||
echo "$k => $up \n";
|
||||
$again++;
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* Pads a number with zeroes to make a nice even lenghted result
|
||||
* Author Carsten Jensen
|
||||
* @param int $int number to be padded
|
||||
* @param int $length of padding
|
||||
* @return int padded number
|
||||
*/
|
||||
function padding($int, $length = 2)
|
||||
{
|
||||
return str_pad($int, $length, 0, STR_PAD_LEFT);
|
||||
}
|
||||
?>
|
Binary file not shown.
Binary file not shown.
@ -0,0 +1,5 @@
|
||||
@echo off
|
||||
php.exe -f correct_pages.php
|
||||
|
||||
echo Job is finished!
|
||||
pause
|
@ -0,0 +1,5 @@
|
||||
for %%i in (*.tif) DO (
|
||||
convert.exe %%i -type Grayscale pages\%%i.png
|
||||
)
|
||||
pause
|
||||
rename pages\*.tif.png pages\*.png
|
@ -0,0 +1,5 @@
|
||||
@echo off
|
||||
for %%i in (*.png) DO (
|
||||
convert "%%i" -quality 85%% "pages\%%~ni.jpg"
|
||||
)
|
||||
pause
|
@ -0,0 +1,6 @@
|
||||
@echo off
|
||||
mkdir pages
|
||||
for %%i in (*.tif) DO (
|
||||
convert "%%i" -quality 85%% "pages\%%~ni.jpg"
|
||||
)
|
||||
pause
|
@ -0,0 +1,65 @@
|
||||
<?php
|
||||
// Author Carsten Jensen aka Tomse
|
||||
// Copyright (c) 2013 Carsten Jensen
|
||||
// Released under GNU GPL v2
|
||||
|
||||
// Corrects page numbers from scanned full-paper pages
|
||||
// which has been split into 2, and been edited in scan tailor
|
||||
|
||||
$ext = '.tif';
|
||||
$files = glob('*.tif');
|
||||
|
||||
// set to 0 if back page lies first, or 1 if frontpage lies first
|
||||
$up = 0;
|
||||
$down = count($files);
|
||||
$dest = 'newpages';
|
||||
$pad = strlen($down)+1;
|
||||
@mkdir($dest);
|
||||
|
||||
$again = 1;
|
||||
$back = true;
|
||||
|
||||
foreach($files as $k => $v)
|
||||
{
|
||||
|
||||
|
||||
if($back === true)
|
||||
{
|
||||
|
||||
copy($v, $dest . DIRECTORY_SEPARATOR . 'page' . padding($down, $pad) . $ext);
|
||||
$down--;
|
||||
if ($again > 2 OR $k == 0)
|
||||
{
|
||||
$again = 1;
|
||||
$back = false;
|
||||
}
|
||||
echo "$k => $down \n";
|
||||
$again++;
|
||||
}
|
||||
else
|
||||
{
|
||||
copy($v, $dest . DIRECTORY_SEPARATOR . 'page' . padding($up, $pad) . $ext);
|
||||
$up++;
|
||||
if ($again > 2)
|
||||
{
|
||||
$again = 1;
|
||||
$back = true;
|
||||
}
|
||||
echo "$k => $up \n";
|
||||
$again++;
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* Pads a number with zeroes to make a nice even lenghted result
|
||||
* Author Carsten Jensen
|
||||
* @param int $int number to be padded
|
||||
* @param int $length of padding
|
||||
* @return int padded number
|
||||
*/
|
||||
function padding($int, $length = 2)
|
||||
{
|
||||
return str_pad($int, $length, 0, STR_PAD_LEFT);
|
||||
}
|
||||
?>
|
20
ScanScripts/Windows/magazines/Rarely used scripts/crop.cmd
Normal file
20
ScanScripts/Windows/magazines/Rarely used scripts/crop.cmd
Normal file
@ -0,0 +1,20 @@
|
||||
if not exist cropped mkdir cropped
|
||||
|
||||
setlocal enabledelayedexpansion enableextensions
|
||||
rem start coords
|
||||
set /a cy=33
|
||||
set /a cx=0
|
||||
|
||||
rem size
|
||||
set x=4045
|
||||
set y=6865
|
||||
|
||||
for %%i in (*.tif) DO (
|
||||
set /A cy=%cy%-4
|
||||
rem convert %%i -crop %x%x%y%+%cx%+!cy! +repage -type Grayscale cropped\%%i.png
|
||||
convert %%i -crop %x%x%y%+%cx%+!cy! +repage cropped\%%i.png
|
||||
)
|
||||
|
||||
endlocal
|
||||
|
||||
rem convert *.jpg -crop 1600x2490+213+2450 +repage pages/even/even.jpg
|
@ -0,0 +1,20 @@
|
||||
if not exist cropped mkdir cropped
|
||||
|
||||
setlocal enabledelayedexpansion enableextensions
|
||||
rem start coords
|
||||
set /a cy=0
|
||||
set /a cx=0
|
||||
|
||||
rem size
|
||||
set x=4473
|
||||
set y=6167
|
||||
|
||||
for %%i in (*.tif) DO (
|
||||
rem set /A cy=%cy%-3
|
||||
rem convert %%i -crop %x%x%y%+%cx%+!cy! +repage -type Grayscale cropped\%%i.png
|
||||
convert %%i -crop %x%x%y%+%cx%+!cy! +repage cropped\%%i.png
|
||||
)
|
||||
|
||||
endlocal
|
||||
|
||||
rem convert *.jpg -crop 1600x2490+213+2450 +repage pages/even/even.jpg
|
@ -0,0 +1,3 @@
|
||||
for %%i in (*.png) DO (
|
||||
convert %%i -resize 4840x3444 small\%%i
|
||||
)
|
@ -0,0 +1,4 @@
|
||||
if not exist rotated mkdir rotated
|
||||
for %%i in (*.png) DO (
|
||||
convert %%i -rotate 90 rotated\%%i
|
||||
)
|
BIN
ScanScripts/Windows/magazines/Rarely used scripts/php.exe
Normal file
BIN
ScanScripts/Windows/magazines/Rarely used scripts/php.exe
Normal file
Binary file not shown.
BIN
ScanScripts/Windows/magazines/Rarely used scripts/php5.dll
Normal file
BIN
ScanScripts/Windows/magazines/Rarely used scripts/php5.dll
Normal file
Binary file not shown.
@ -0,0 +1,18 @@
|
||||
@echo off
|
||||
setlocal enabledelayedexpansion enableextensions
|
||||
rem 0 = rotate right the first time, then alternate
|
||||
set left=0
|
||||
|
||||
IF NOT EXIST pages mkdir pages
|
||||
for %%i in (*.tif) DO (
|
||||
IF !left! equ 1 (
|
||||
convert %%i -rotate -90 pages/%%~ni.png
|
||||
set left=0
|
||||
) else (
|
||||
convert %%i -rotate 90 pages/%%~ni.png
|
||||
set left=1
|
||||
)
|
||||
)
|
||||
|
||||
|
||||
endlocal
|
@ -0,0 +1,4 @@
|
||||
IF NOT EXIST pages mkdir pages
|
||||
for %%i in (*.tif) DO (
|
||||
convert %%i -rotate -90 pages/%%i.png
|
||||
)
|
@ -0,0 +1,2 @@
|
||||
php.exe -f correct_pages.php
|
||||
pause
|
@ -0,0 +1,9 @@
|
||||
@echo off
|
||||
mkdir work
|
||||
cd origs
|
||||
for %%i in (*.tif) DO (
|
||||
convert %%i -level 19%%,58%% ..\work\%%i
|
||||
)
|
||||
for %%i in (*.png) DO (
|
||||
convert %%i -level 19%%,58%% ..\work\%%i
|
||||
)
|
@ -0,0 +1,4 @@
|
||||
mkdir indexed
|
||||
for %%i in (*.tif) DO (
|
||||
convert %%i +dither -remap D:\Retro-Work\3col.png indexed\%%~ni.png
|
||||
)
|
4
ScanScripts/Windows/magazines/old/1 - grayscale.cmd
Normal file
4
ScanScripts/Windows/magazines/old/1 - grayscale.cmd
Normal file
@ -0,0 +1,4 @@
|
||||
mkdir pages
|
||||
for %%i in (*.tif) DO (
|
||||
convert %%i -grayscale rec709luma pages\%%i
|
||||
)
|
@ -0,0 +1,9 @@
|
||||
@echo off
|
||||
cd work/out
|
||||
mkdir resample
|
||||
for %%i in (*.tif) DO (
|
||||
convert -units PixelsPerInch "%%i" -density 400 "resample\%%i"
|
||||
)
|
||||
for %%i in (*.png) DO (
|
||||
convert -units PixelsPerInch "%%i" -density 400 "resample\%%i"
|
||||
)
|
@ -0,0 +1,9 @@
|
||||
@echo off
|
||||
cd work/out
|
||||
mkdir resample
|
||||
for %%i in (*.tif) DO (
|
||||
convert -units PixelsPerInch "%%i" -density 600 "resample\%%i"
|
||||
)
|
||||
for %%i in (*.png) DO (
|
||||
convert -units PixelsPerInch "%%i" -density 600 "resample\%%i"
|
||||
)
|
4
ScanScripts/Windows/magazines/old/2 - G4_Compress.cmd
Normal file
4
ScanScripts/Windows/magazines/old/2 - G4_Compress.cmd
Normal file
@ -0,0 +1,4 @@
|
||||
@echo off
|
||||
mkdir work\out\g4compressed
|
||||
cd work\out
|
||||
"c:\Program Files (x86)\IrfanView\i_view32.exe" .\*.tif /tifc=4 /convert=.\g4compressed\*.tif
|
73
ScanScripts/Windows/magazines/old/2 - Make pdf.cmd
Normal file
73
ScanScripts/Windows/magazines/old/2 - Make pdf.cmd
Normal file
@ -0,0 +1,73 @@
|
||||
@echo off
|
||||
rem *****************************
|
||||
rem * 2015 Carsten Jensen / DDHF
|
||||
rem * Script til behandling af
|
||||
rem * indscannede sider
|
||||
rem *****************************
|
||||
|
||||
|
||||
setlocal EnableDelayedExpansion
|
||||
set folder=%cd%
|
||||
cd work\out
|
||||
echo tryk CTRL-C hvis du vil afbryde processen.
|
||||
choice /m "Ret side orden "
|
||||
if %errorlevel%==1 (
|
||||
|
||||
REM Rediger nedenstående stå så den passer med dit setup.
|
||||
copy ..\correct_pages.php .\ /y
|
||||
php -f correct_pages.php
|
||||
cd newpages
|
||||
)
|
||||
|
||||
if NOT EXIST output mkdir output
|
||||
set thumb=1
|
||||
|
||||
|
||||
choice /C SF /m "S/H (S) eller Farver (jpg komprimering) (F)"
|
||||
echo.
|
||||
echo Arbejder vent venligst...
|
||||
echo.
|
||||
|
||||
if %errorlevel%==2 (
|
||||
REM Opret Farve Dokument (jpg komprimering)
|
||||
for %%i in (*.tif) DO (
|
||||
if !thumb!==1 (
|
||||
convert %%i -resize 240x310^^! -quality 75%% "!folder!\thumb.jpg"
|
||||
)
|
||||
set thumb=2
|
||||
convert %%i -quality 95%% output\%%~ni.jpg
|
||||
)
|
||||
|
||||
cd output
|
||||
for %%i in (*.jpg) DO (
|
||||
convert %%i %%~ni.pdf
|
||||
)
|
||||
del *.jpg /q
|
||||
) else if %errorlevel%==1 (
|
||||
REM Opret S/H Dokument (ingen jpg komprimering)
|
||||
for %%i in (*.tif) DO (
|
||||
if !thumb!==1 (
|
||||
convert %%i -resize 240x310^^! -quality 80%% "!folder!\thumb.jpg"
|
||||
)
|
||||
set thumb=2
|
||||
convert %%i output\%%~ni.pdf
|
||||
)
|
||||
cd output
|
||||
) else goto error
|
||||
|
||||
|
||||
pdftk *.pdf cat output %folder%\dokument.pdf
|
||||
del *.pdf /q
|
||||
|
||||
:success
|
||||
Echo PDF + Thumb oprettet
|
||||
goto end
|
||||
|
||||
:error
|
||||
Echo der opstod en fejl, evt i dit valg.
|
||||
goto end
|
||||
|
||||
|
||||
|
||||
:end
|
||||
pause
|
@ -0,0 +1,9 @@
|
||||
@echo off
|
||||
mkdir work
|
||||
cd origs
|
||||
for %%i in (*.tif) DO (
|
||||
convert %%i -level 11%%,86%% ..\work\%%i
|
||||
)
|
||||
for %%i in (*.png) DO (
|
||||
convert %%i -level 11%%,86%% ..\work\%%i
|
||||
)
|
@ -0,0 +1,13 @@
|
||||
#!/bin/bash
|
||||
mkdir work
|
||||
|
||||
cd origs
|
||||
|
||||
for i in *.tif
|
||||
do
|
||||
convert $i -level 11%%,86% ../work/$i
|
||||
done
|
||||
for i in *.png
|
||||
do
|
||||
convert $i -level 11%%,86% ../work/$i
|
||||
done
|
7
ScanScripts/Windows/magazines/work/1 - grayscale.cmd
Normal file
7
ScanScripts/Windows/magazines/work/1 - grayscale.cmd
Normal file
@ -0,0 +1,7 @@
|
||||
mkdir pages
|
||||
for %%i in (*.tif) DO (
|
||||
convert %%i -grayscale rec709luma pages\%%i
|
||||
)
|
||||
for %%i in (*.png) DO (
|
||||
convert %%i -grayscale rec709luma pages\%%i
|
||||
)
|
11
ScanScripts/Windows/magazines/work/1_-_grayscale.sh
Normal file
11
ScanScripts/Windows/magazines/work/1_-_grayscale.sh
Normal file
@ -0,0 +1,11 @@
|
||||
#!/bin/bash
|
||||
|
||||
mkdir pages
|
||||
for i in *.tif
|
||||
do
|
||||
convert $i -grayscale rec709luma pages/$i
|
||||
done
|
||||
for i in *.png
|
||||
do
|
||||
convert $i -grayscale rec709luma pages/$i
|
||||
done
|
@ -0,0 +1,47 @@
|
||||
@echo off
|
||||
setlocal EnableDelayedExpansion
|
||||
set folder=%cd%
|
||||
cd work\out
|
||||
choice /m "Fix paging "
|
||||
if %errorlevel%==1 (
|
||||
copy D:\Retro-Work\correct_pages.php .\ /y
|
||||
php -f correct_pages.php
|
||||
cd newpages
|
||||
)
|
||||
|
||||
if NOT EXIST output mkdir output
|
||||
set thumb=1
|
||||
|
||||
if NOT EXIST audiomedia mkdir audiomedia
|
||||
|
||||
|
||||
for %%i in (*.tif) DO (
|
||||
if !thumb!==1 (
|
||||
convert %%i -resize 240x310^^! -quality 75%% !folder!\thumb.jpg
|
||||
)
|
||||
set thumb=2
|
||||
convert -units pixelsperinch %%i -resample 150 audiomedia\%%~ni.jpg
|
||||
convert %%i -quality 95%% output\%%~ni.jpg
|
||||
)
|
||||
|
||||
rem 300dpi mag
|
||||
cd output
|
||||
for %%i in (*.jpg) DO (
|
||||
convert %%i %%~ni.pdf
|
||||
)
|
||||
|
||||
del *.jpg /q
|
||||
pdftk *.pdf cat output "%folder%\mag.pdf"
|
||||
del *.pdf /q
|
||||
cd ..
|
||||
|
||||
|
||||
rem Tablet
|
||||
cd audiomedia
|
||||
for %%i in (*.jpg) DO (
|
||||
convert %%i %%~ni.pdf
|
||||
)
|
||||
del *.jpg /q
|
||||
pdftk *.pdf output "%folder%\audiomedia.pdf"
|
||||
del *.pdf /q
|
||||
pause
|
@ -0,0 +1,57 @@
|
||||
@echo off
|
||||
setlocal EnableDelayedExpansion
|
||||
set folder=%cd%
|
||||
cd work\out
|
||||
choice /m "Fix paging "
|
||||
if %errorlevel%==1 (
|
||||
copy D:\Retro-Work\correct_pages.php .\ /y
|
||||
php -f correct_pages.php
|
||||
cd newpages
|
||||
)
|
||||
|
||||
choice /C LSN /m "Use large (L), small (S) or no (N) lastpage "
|
||||
if %errorlevel%==1 (
|
||||
set page=brought_to_you_by.pdf
|
||||
) else if %errorlevel%==2 (
|
||||
set page=brought_to_you_by_[TABLET].pdf
|
||||
)
|
||||
|
||||
if NOT EXIST output mkdir output
|
||||
set thumb=1
|
||||
|
||||
if NOT EXIST tablet mkdir tablet
|
||||
|
||||
|
||||
for %%i in (*.tif) DO (
|
||||
if !thumb!==1 (
|
||||
convert %%i -resize 240x310^^! -quality 75%% "!folder!\thumb.jpg"
|
||||
)
|
||||
set thumb=2
|
||||
convert %%i -resize 1024x4096 -quality 95%% tablet\%%~ni.jpg
|
||||
convert %%i -quality 95%% output\%%~ni.jpg
|
||||
)
|
||||
|
||||
rem 300dpi mag
|
||||
cd output
|
||||
for %%i in (*.jpg) DO (
|
||||
convert %%i %%~ni.pdf
|
||||
)
|
||||
|
||||
del *.jpg /q
|
||||
pdftk *.pdf D:\Retro-Work\brought_to_you_by.pdf cat output "!folder!\_mag.pdf"
|
||||
pdftk "!folder!\_mag.pdf" update_info D:\Retro-Work\metadata.txt output "!folder!\mag.pdf"
|
||||
del *.pdf /q
|
||||
del "!folder!\_mag.pdf"
|
||||
cd ..
|
||||
|
||||
|
||||
rem Tablet
|
||||
cd tablet
|
||||
for %%i in (*.jpg) DO (
|
||||
convert %%i %%~ni.pdf
|
||||
)
|
||||
del *.jpg /q
|
||||
pdftk *.pdf D:\Retro-Work\brought_to_you_by_[TABLET].pdf cat output _tablet.pdf
|
||||
pdftk _tablet.pdf update_info D:\Retro-Work\metadata.txt output "!folder!\_tablet.pdf"
|
||||
del *.pdf /q
|
||||
pause
|
@ -0,0 +1,37 @@
|
||||
#!/bin/sh
|
||||
cd work/out
|
||||
|
||||
mkdir output
|
||||
mkdir audiomedia
|
||||
|
||||
|
||||
for i in *.tif
|
||||
do
|
||||
convert -units pixelsperinch $i -resample 150 audiomedia/$i.jpg
|
||||
convert $i -quality 95% output/$i.jpg
|
||||
done
|
||||
|
||||
rem 300dpi mag
|
||||
cd output
|
||||
for i in *.jpg
|
||||
do
|
||||
convert $i $i.pdf
|
||||
done
|
||||
|
||||
rm *.jpg
|
||||
pdftk *.pdf cat output ../../../mag.pdf
|
||||
rm *.pdf
|
||||
cd ..
|
||||
|
||||
|
||||
rem Tablet
|
||||
cd audiomedia
|
||||
for i in *.jpg
|
||||
do
|
||||
convert $i $i.pdf
|
||||
done
|
||||
|
||||
rm *.jpg
|
||||
pdftk *.pdf output ../../../audiomedia.pdf
|
||||
rm *.pdf
|
||||
|
@ -0,0 +1,57 @@
|
||||
@echo off
|
||||
setlocal EnableDelayedExpansion
|
||||
set folder=%cd%
|
||||
cd work\out
|
||||
choice /m "Fix paging "
|
||||
if %errorlevel%==1 (
|
||||
copy D:\Retro-Work\correct_pages.php .\ /y
|
||||
php -f correct_pages.php
|
||||
cd newpages
|
||||
)
|
||||
|
||||
choice /C LSN /m "Use large (L), small (S) or no (N) lastpage "
|
||||
if %errorlevel%==1 (
|
||||
set page=brought_to_you_by.pdf
|
||||
) else if %errorlevel%==2 (
|
||||
set page=brought_to_you_by_[TABLET].pdf
|
||||
)
|
||||
|
||||
if NOT EXIST output mkdir output
|
||||
set thumb=1
|
||||
|
||||
if NOT EXIST tablet mkdir tablet
|
||||
|
||||
|
||||
for %%i in (*.tif) DO (
|
||||
if !thumb!==1 (
|
||||
convert %%i -resize 240x310^^! -quality 75%% "!folder!\thumb.jpg"
|
||||
)
|
||||
set thumb=2
|
||||
convert %%i -resize 1024x4096 -quality 95%% tablet\%%~ni.jpg
|
||||
convert %%i -quality 95%% output\%%~ni.jpg
|
||||
)
|
||||
|
||||
rem 300dpi mag
|
||||
cd output
|
||||
for %%i in (*.jpg) DO (
|
||||
convert %%i %%~ni.pdf
|
||||
)
|
||||
|
||||
del *.jpg /q
|
||||
pdftk *.pdf D:\Retro-Work\brought_to_you_by.pdf cat output "!folder!\_mag.pdf"
|
||||
pdftk "!folder!\_mag.pdf" update_info D:\Retro-Work\metadata.txt output "!folder!\mag.pdf"
|
||||
del *.pdf /q
|
||||
del "!folder!\_mag.pdf"
|
||||
cd ..
|
||||
|
||||
|
||||
rem Tablet
|
||||
cd tablet
|
||||
for %%i in (*.jpg) DO (
|
||||
convert %%i %%~ni.pdf
|
||||
)
|
||||
del *.jpg /q
|
||||
pdftk *.pdf D:\Retro-Work\brought_to_you_by_[TABLET].pdf cat output _tablet.pdf
|
||||
pdftk _tablet.pdf update_info D:\Retro-Work\metadata.txt output "!folder!\_tablet.pdf"
|
||||
del *.pdf /q
|
||||
pause
|
BIN
ScanScripts/Windows/sort/backward/Thumbs.db
Normal file
BIN
ScanScripts/Windows/sort/backward/Thumbs.db
Normal file
Binary file not shown.
32
ScanScripts/Windows/sort/forward.php
Normal file
32
ScanScripts/Windows/sort/forward.php
Normal file
@ -0,0 +1,32 @@
|
||||
<?php
|
||||
|
||||
$forward = glob('./forward/*.tif');
|
||||
$backward = glob('./backward/*.tif');
|
||||
rsort($backward);
|
||||
$output = './output/';
|
||||
$fcount = 1;
|
||||
$bcount = 2;
|
||||
|
||||
if(!file_exists($output)) mkdir($output, 0777, true);
|
||||
|
||||
foreach($forward as $fk => $fv)
|
||||
{
|
||||
|
||||
echo $fk . ' => ' . $fv . "\n";
|
||||
copy($fv, $output . str_pad($fcount, 4, 0, STR_PAD_LEFT) . '.tif');
|
||||
$fcount += 2;
|
||||
}
|
||||
|
||||
foreach($backward as $bk => $bv)
|
||||
{
|
||||
|
||||
if ($bk % 2 != 0)
|
||||
{
|
||||
echo $bk . ' => ' . $bv . "\n";
|
||||
copy($bv, $output . str_pad($bcount, 4, 0, STR_PAD_LEFT) . '.tif');
|
||||
$bcount += 2;
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
?>
|
BIN
ScanScripts/Windows/sort/forward/Thumbs.db
Normal file
BIN
ScanScripts/Windows/sort/forward/Thumbs.db
Normal file
Binary file not shown.
BIN
ScanScripts/Windows/sort/php.exe
Normal file
BIN
ScanScripts/Windows/sort/php.exe
Normal file
Binary file not shown.
BIN
ScanScripts/Windows/sort/php5.dll
Normal file
BIN
ScanScripts/Windows/sort/php5.dll
Normal file
Binary file not shown.
2
ScanScripts/Windows/sort/runme.cmd
Normal file
2
ScanScripts/Windows/sort/runme.cmd
Normal file
@ -0,0 +1,2 @@
|
||||
php.exe -f forward.php
|
||||
pause
|
Loading…
Reference in New Issue
Block a user