Skip to content

zamzar/zamzar-bash

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

10 Commits
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Introduction

This repository provides a simple Bash Command Line program (zamzar.sh) for using the REST-based Zamzar file conversion API. It has been tested on OSX but should also work with cygwin (on Windows) and Linux since it uses standard Bash conventions.

You will need to have cURL installed on your system to use this script.

If you find any issues please raise them against this repository, since it is monitored by the Zamzar development team. We welcome pull requests and suggestions for improvements. The code in this repository is MIT licensed.

Installation

Usage

  • To find out what "to" formats are available for conversion for a given input file:

      ./zamzar.sh ~/portrait.jpg
    

    … should output:

      - bmp (1 credits)
      - gif (1 credits)
      - ico (1 credits)
      - pcx (1 credits)
      - pdf (1 credits)
      - png (1 credits)        
      - ps (1 credits)
      - tga (1 credits)
      - thumbnail (1 credits)
      - tiff (1 credits)
      - wbmp (1 credits)
      - webp (1 credits)
    
  • To convert a file into a different format and automatically download and save it to your current working directory with the same name and the file extension of the converted format:

      ./zamzar.sh ~/portrait.jpg png
    

    … should output:

      Job 313 is successful
      Downloading converted file(s) for job 313
      Converted file (id #2870) saved to: portrait.png
    
  • To convert a file into a different format and automatically download and save it to a different directory:

      ./zamzar.sh ~/portrait.jpg png ~/Downloads/
    
  • To print out the version of the script being used:

      ./zamzar.sh -v
    
  • To run a conversion in "debug" mode (useful for examining the cURL commands being run under the covers):

      ./zamzar.sh -d ~/portrait.jpg png
    

Further Reading

If you want to browse all the formats you can convert "from" and "to" using the Zamzar API then check out https://developers.zamzar.com/formats

If you want to extend this script to perform more advanced functions why not take a look at our comprehensive documentation which gives information on other operations and endpoints available in the API.

About

Convert files from the command line using Zamzar

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages