Skip to content

Node app for shell and batch usage

Ophir LOJKINE edited this page Sep 12, 2019 · 7 revisions

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.

Requirements

Usage

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.

Batch usage

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 on macOS

  1. Install Homebrew.

  2. Install NodeJS:

    xcode-select --install
    brew install node
  3. Download the script for Dezoomify from GitHub:

    git clone https://github.com/lovasoa/dezoomify.git
  4. Change the Terminal directory to the application repository:

    cd dezoomify/node-app
  5. Install dependencies:

    npm install
  6. 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 to dezoomify/node-app before running the line above.

  7. Now that the image has been downloaded, locate the node-app folder to find the .jpg (you should be able to find it in Users/yourUserName/dezoomify/node-app).

Install on Ubuntu

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"

asciicast