Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Documentation improvement about "stop downloading the image after a few kilobytes" #32

Open
rogerdielrton opened this issue Oct 13, 2014 · 10 comments
Milestone

Comments

@rogerdielrton
Copy link

Hello.
In "usage" doc, when you say:
"You can optionally check the buffer lengths & stop downloading the image after
a few kilobytes. You don't need to download the entire image"
Could you be most explicit about how many (minimum) kb per file type is required to
detect image dimensions?
Could you update the documentation, with that info and an example?
Thanks in advance.

@rogerdielrton
Copy link
Author

Something similar to:
https://github.com/arnaud-lb/imagesize.js
Get the size of an image without reading or downloading it entirely

@netroy netroy self-assigned this Oct 17, 2014
@jspenc72
Copy link

Please do improve documentation for this.

@kurijov
Copy link

kurijov commented Jul 29, 2015

+1

@rauschma
Copy link

rauschma commented Aug 2, 2015

Two ideas come to mind:

  • A constant that tells you how much data is enough for all image formats to determine the dimensions.
  • A function that checks whether enough data has already been loaded.

@andressrg
Copy link

@rogerdielrton http-image-size does what you want to accomplish.

It even uses image-size.

@derwaldgeist
Copy link

+1
Also would like to see that, since performance improvement is important. My use-case is to detect the 5 largest images in a page, so I do not need the image content.

@derwaldgeist
Copy link

@rogerdielrton Well, this implementation just relies on the first chunk to contain all relevant data. The question still is: is this sufficient in every case?

@Alino
Copy link

Alino commented Oct 15, 2015

+1

@puzrin
Copy link

puzrin commented Oct 16, 2015

https://github.com/nodeca/probe-image-size - it's specially designed to download only the necessary part of image.

@AlastairTaft
Copy link

+1

@netroy netroy removed their assignment Nov 24, 2015
@netroy netroy added this to the 1.0.0 milestone Dec 16, 2017
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

10 participants