Giter VIP home page Giter VIP logo

images's Introduction

Fetches images from https://placeimg.com/ to use for development / testing / etc.

I grew tired of googling images whenever I do testing, so I decided that all I want is a simple script to kick off and get images of exactly the size I want for testing / development. This script does just that. The repo comes with built-in images samples in std directory. Whenever ./fetch is called to fetch image(s), it will drop those into gen directory (if --dir options is not specified). So, suppose you need a 1280x1024 for testing something on your brand new cool website. Instead of googling for such an image with this script you'd do ./fetch 1280x1024 and that's it. And if you need 10 images of the same size, that's as easy as ./fetch 1280x1024:10

Note: the script is written in Python v 2.7 (since it's already installed on majority of Linux/MacOS machines by default), urllib2 was used intentionally so that we don't require to pull down any dependencies, otherwise I'd rather use something fancier like requests, which is an amazing python lib for HTTP.

How to use

Simply run

./fetch WIDTHxHEIGHT[:CATEGORY][:FILTER][:NUMBER]

and the script will fetch images from https://placeimg.com/ into gen directory (by default, this options is configurable with --dir option.

Whole usage is:

$ ./fetch --help
usage: fetch [-h] [-d DIRECTORY] [SPECIFICATION [SPECIFICATION ...]]

Fetches images from placeimg.com for testing while developing your beautiful app

    Available image categories are: 'animals', 'arch', 'nature', 'people', 'tech'
    Available image filters are:    'grayscale', 'sepia'

    Specification format is: WIDTHxHEIGHT[:CATEGORY][:FILTER][:NUMBER]

positional arguments:
  SPECIFICATION         Specification

optional arguments:
  -h, --help            show this help message and exit
  -d DIRECTORY, --dir DIRECTORY
                        Output directory

Call samples

$ ./fetch 600x400:PEOPLE:SEPIA:3 100x100:TECH 1200x800:SEPIA:2
Written: gen/600x400_PEOPLE_SEPIA.jpg
Written: gen/600x400_PEOPLE_SEPIA_1.jpg
Written: gen/600x400_PEOPLE_SEPIA_2.jpg
Written: gen/100x100_TECH.jpg
Written: gen/1200x800_SEPIA.jpg
Written: gen/1200x800_SEPIA_1.jpg

$ ./fetch 600x400:TECH
Written: gen/600x400_TECH.jpg

$ ./fetch 600x400
Written: gen/600x400.jpg

images's People

Contributors

nemoden avatar

Stargazers

 avatar

Watchers

 avatar  avatar  avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.