-
-
Notifications
You must be signed in to change notification settings - Fork 76
Node app for shell and batch usage
Important note: If you are looking for a fast and easy-to-use command-line dezoomification tool, have a look at dezoomify-rs first.
Dezoomify can be used through the Terminal for faster operation, batch processing, and saving large images. This works through a Node.js application that downloads the image and saves it.
A separate shell script is also available.
- NodeJS, version 6 or greater.
- node-canvas
Run the dezoomify-node.js
script in the node-app
directory of this repository:
node dezoomify-node.js "[url]" "[filename]"
It takes two arguments
-
[URL]
the url of the page containing the image you want to dezoomify -
[filename]
where you want to save the generated JPEG file.
You can use the Node app to download a series of images through the terminal, using a command such as the following:
for i in {1..25}; do node dezoomify-node.js "https://example.url/item/${i}/" "${i}.jpg"; sleep $[ ( $RANDOM % 10 ) + 1 ]; done
The sleep
command pauses Dezoomify between each image to reduce server load (in this case for a random number of seconds between 1 and 10).
-
Install NodeJS:
xcode-select --install brew install node
-
Download the script for Dezoomify from GitHub:
git clone https://github.com/lovasoa/dezoomify.git
-
Change the Terminal directory to the application repository:
cd dezoomify/node-app
-
Install dependencies:
npm install
-
Test to see if it worked:
node dezoomify-node.js "https://www.wdl.org/en/item/179/view/1/1/" "1.jpg"
Note: To run the line above, you must change the directory to
dezoomify/node-app
. If you close the Terminal, open it back up again, and run this line without changing the directory, it will not work. You must first change the directory todezoomify/node-app
before running the line above. -
Now that the image has been downloaded, locate the
node-app
folder to find the .jpg (you should be able to find it inUsers/yourUserName/dezoomify/node-app
).
On Ubuntu, copy and paste this into a terminal:
curl -sL https://deb.nodesource.com/setup_6.x | sudo -E bash -
sudo apt-get install nodejs libcairo2-dev libjpeg8-dev libpango1.0-dev libgif-dev build-essential g++
git clone https://github.com/lovasoa/dezoomify.git
cd dezoomify/node-app
npm install
node dezoomify-node.js "https://www.wdl.org/en/item/179/view/1/1/" "1.jpg"