120 Commits

Author SHA1 Message Date
Fabrizio Monti
fcf871e637 Identify svg files that start with white spaces 2021-02-16 10:26:31 +01:00
Stephen Sykes
fd3b5f2c4c
Merge pull request #123 from Nakilon/master
force_encoding was called on Net::ReadAdapter when url is webmocked
fixes #121
2021-01-30 13:02:48 +02:00
Victor Maslov
437318220b force_encoding was called on Net::ReadAdapter when url is webmocked 2021-01-30 12:41:27 +03:00
Bianca Nenciu
c78578c097
Fix GIF global color table flag check
Zero is a truthy value, which is a problem when checking flags.
2021-01-21 17:20:51 +02:00
Bianca Nenciu
f1628c1539
Use frames count instead of delay to check animated GIFs
There are GIFs with multiple frames and zero delay, but also GIFs with
a single frame and positive delay. The old algorithm failed for this
kind of images.
2020-11-02 20:25:15 +02:00
PikachuEXE
172b674a40 * Replace URI.escape with ::URI::DEFAULT_PARSER.escape
Similar code change
https://github.com/mongodb/mongo-ruby-driver/pull/1614/files
2020-07-23 15:22:29 +08:00
PikachuEXE
45521bfd3e Fix handling of redirect response without Location header 2020-06-18 11:56:03 +08:00
Stephen Sykes
b58af86658 Fix returning nil if image type not gif for animated 2020-06-14 11:54:55 +03:00
Stephen Sykes
967737b844
Merge pull request #114 from nbianca/master
Add API to check if a GIF is animated
2020-06-14 11:39:32 +03:00
Bianca Nenciu
df31108b00 Add check for animated GIFs 2020-06-12 15:00:26 +03:00
Gerhard Schlager
2e0436c58f Avoid detecting arbitrary XML as SVG 2020-05-26 16:53:50 +02:00
abcang
6f548c5509 Supports various bitmap headers 2019-09-05 14:43:11 +09:00
Sebastian Razola
ddfb29998a
Support proxies that require a username and password 2019-03-19 18:35:14 +01:00
Yahor Zhylinski
3c5971e5b4 Handle Errno::ENETUNREACH exception 2019-03-13 09:21:07 +03:00
Dmitry Borisov
11ca295071 Should work for readed ios 2018-11-29 13:15:28 +03:00
Stephen Sykes
aa097226e8 Avoid detecting CR2 and CRW as tiff. Use own fakeweb. Fixes #104 2018-09-09 22:39:40 +03:00
Stephen Sykes
15bc4111c4 Only escape location in redirect if needed. Fixes #103 2018-05-08 22:12:16 +03:00
Stephen Sykes
a6222c47a5
Merge pull request #101 from Nakilon/master
unescaped space symbol in redirect caused URI::InvalidURIError
2018-05-01 14:45:51 +03:00
Stephen Sykes
15f3e95b25 Only pay attention to first APP1 segment for orientation. Fixes #102 2018-05-01 14:39:10 +03:00
Victor Maslov
abccdd1365 unescaped space symbol in redirect caused URI::InvalidURIError 2018-04-25 22:48:36 +03:00
Stephen Sykes
c7cad12fa0
Merge pull request #99 from Nakilon/master
better redirect handling
2018-04-20 13:54:26 +03:00
Shinichi NOMURA
2da45b1ed9 Rescue OpenSSL::SSL::SSLError 2018-04-20 17:58:39 +09:00
Victor Maslov
1be9e5cd7a better redirect handling 2018-04-04 17:09:14 +03:00
Stephen Sykes
32b5ba5c4b Add fix for data uri content length 2017-12-18 12:16:57 +02:00
Régis Hanol
2b4b69d80e add support for doctype in SVG 2017-08-07 10:14:37 +02:00
FUJI Goro (gfx)
e46c41a507 add frozen_string_literal: true 2017-07-04 11:32:25 +09:00
dcorrigan
bb4e64a455 declare instance variables explicitly 2017-05-05 09:33:04 -04:00
Stephen Sykes
0adc60812c Use viewbox if width and height are not present in svg. Fixes #76 2017-02-23 21:35:14 +02:00
Stephen Sykes
406c2a5734 Remove fiber require - not needed after all 2017-02-22 23:50:09 +02:00
Stephen Sykes
bd150b54af Fix parsing for svg with longer preamble 2017-02-22 23:47:56 +02:00
Stephen Sykes
ab07d1fe21 Set content length for local files. Fixes #77 2017-02-22 22:59:30 +02:00
Stephen Sykes
c89f556204 Fix protocol relative redirects, make new URI object if needed 2017-02-22 19:28:35 +02:00
Stephen Sykes
955d77a7e9 Merge pull request #78 from dennyac/handle-protocol-relative-uls
Handle protocol relative urls
2017-02-22 18:54:34 +02:00
Stephen Sykes
b8e0bd7afb Merge branch 'master' into master 2017-02-22 08:13:37 -08:00
Stephen Sykes
31042836d4 Remove addressable, include patch for older ruby versions than 2.2 2017-02-22 17:41:55 +02:00
Denny Abraham Cheriyan
88e2098d65 Handle protocol relative urls 2017-02-12 15:55:32 -08:00
Juan Schwindt
cbc17cbf69 Add support for Data Uri Scheme 2016-12-27 21:48:23 -03:00
Bert Goethals
13b0244968 Improve parse_type UnknownImageType detection
In case of 'ice' file type when neither 1 or 2 is found it should raise ```UnknownImageType``` but it didn't, probably due to the method not being 100% DRY.

This commit fixes both issues at once
2016-10-17 17:10:38 +02:00
Stephen Sykes
c99b127d1b Add skip mechanism, to not read skipped bytes into memory. Fixes #70 2016-06-07 10:49:40 +03:00
Michiel de Wit
2453c60d6e For ICO files, return the largest size (by number of pixels) rather than the size of the first icon 2016-04-18 21:08:26 +02:00
Stephen Sykes
67d2368176 Drop dead link 2016-03-24 18:33:44 +02:00
Stephen Sykes
e54e1e0b23 Remove support for 1.8.7, bump major version 2016-03-24 18:12:48 +02:00
Janko Marohnić
04d1030756 Always rewind the given IO
When an error occured when extracting dimensions, rewinding would be
skipped and the code would jump straight to "rescue" statements. We want
that the IO is always rewinded, even in case of errors.

Note that this doesn't affect the return value of the method, because
the return value of a method-level "ensure" is always ignored by Ruby.
2016-03-08 21:09:42 +07:00
Stephen Sykes
f3ee9eeace Adds orientation reader and tests 2016-02-13 23:47:11 +02:00
Jeremy Venezia
4c1905fd66 raise UnknownImageType when file is non-svg xml 2015-12-01 17:49:05 +01:00
Stephen Sykes
3c0c290ac8 Fix grammar erros, add info about headers to rdoc 2015-11-13 11:07:29 +02:00
andfx
ad567ff0da Support additional HTTP headers 2015-11-09 21:10:16 +01:00
Stephen Sykes
308e20cf45 More doc, set content_length earlier 2015-05-12 14:40:53 +03:00
Stephen Sykes
013cd81ddb Merge pull request #52 from lulalala/file_size
Add reader for request header content-length
2015-05-12 14:25:46 +03:00
lulalala
fe5b4d7f04 Add reader for request header content-length 2015-05-11 20:05:14 +08:00