Skip to content

pyimgdown is a python module for downloading image using url and resizing.

Notifications You must be signed in to change notification settings

mpoulin/pyimgdown

 
 

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

6 Commits
 
 
 
 
 
 
 
 
 
 

Repository files navigation

pyimgdown is a python module for downloading image using url and resizing.

Installation

pip install pyimgdown

Features

  • download image from url.
  • resize and attach "_thumbnail" suffix.
  • single url mode and file (url list file) mode.
  • specify download directory.

Usage

url

> import pyimgdown
> url = "https://localhost/test.jpeg"
> pyimgdown.download(url=url)
...
=> {'image': './PyImgDown/test.jpeg'}

file

> import pyimgdown<br/>
> pyimgdown.download(file="./url_list.txt")<br/>
...
[
{'image': u'./PyImgDown/test1.jpg'},
{'image': u'./PyImgDown/test2.jpg'},
{'image': u'./PyImgDown/test3.jpg'},
{'image': u'./PyImgDown/test4.jpg'},
{'image': u'./PyImgDown/test5.jpg'},
{'image': u'./PyImgDown/test6.jpg'},
{'image': u'./PyImgDown/test7.jpg'},
{'image': u'./PyImgDown/test8.jpg'},
{'image': u'./PyImgDown/test9.jpg'},
{'image': u'.PyImgDown/test10.jpg'}
]

url+thumbnail

> pyimgdown.download(url="https://localhost/test.jpeg", thumbnail_size=(64,64))
{
'image': './PyImgDown/test.jpeg',
'thumbnail': './PyImgDown/test_thumbnail.jpeg'
}

url+thumbnail+download directory

> pyimgdown.download(url="https://localhost/test.jpeg", thumbnail_size=(64,64), download_dir="./download")
{
'image': './download/test.jpeg',
'thumbnail': './download/test_thumbnail.jpeg'
}

About

pyimgdown is a python module for downloading image using url and resizing.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published