image_size 1.5.0 → 2.1.1

Sign up to get free protection for your applications and to get access to all the features.
@@ -1,69 +1,96 @@
1
+ # frozen_string_literal: true
2
+
1
3
  require 'rspec'
2
4
  require 'image_size'
5
+ require 'tempfile'
3
6
 
4
7
  describe ImageSize do
8
+ max_filesize = 16_384
9
+
5
10
  (Dir['spec/images/*/*.*'] + [__FILE__]).each do |path|
6
- name = File.basename(path)
7
- match = /(\d+)x(\d+)\.([^.]+)$/.match(name)
8
- width, height, format = match[1].to_i, match[2].to_i, match[3].to_sym if match
9
- data = File.open(path, 'rb', &:read)
11
+ filesize = File.size(path)
12
+ warn "#{path} is too big #{filesize} (max #{max_filesize})" if filesize > max_filesize
10
13
 
11
- it "gets format and dimensions of #{name} given as IO" do
12
- File.open(path, 'rb') do |fh|
13
- is = ImageSize.new(fh)
14
- expect([is.format, is.width, is.height]).to eq([format, width, height])
15
- expect(fh).not_to be_closed
16
- fh.rewind
17
- expect(fh.read).to eq(data)
14
+ describe "for #{path}" do
15
+ let(:name){ File.basename(path) }
16
+ let(:attributes) do
17
+ match = /(\d+)x(\d+)\.([^.]+)$/.match(name)
18
+ width, height, format = match[1].to_i, match[2].to_i, match[3].to_sym if match
19
+ size = format && [width, height]
20
+ {
21
+ :format => format,
22
+ :width => width,
23
+ :height => height,
24
+ :w => width,
25
+ :h => height,
26
+ :size => size,
27
+ }
18
28
  end
19
- end
29
+ let(:file_data){ File.open(path, 'rb', &:read) }
20
30
 
21
- it "gets format and dimensions of #{name} given as StringIO" do
22
- io = StringIO.new(data)
23
- is = ImageSize.new(io)
24
- expect([is.format, is.width, is.height]).to eq([format, width, height])
25
- expect(io).not_to be_closed
26
- io.rewind
27
- expect(io.read).to eq(data)
28
- end
31
+ context 'given as data' do
32
+ it 'gets format and dimensions' do
33
+ data = file_data.dup
34
+ image_size = ImageSize.new(data)
35
+ expect(image_size).to have_attributes(attributes)
36
+ expect(data).to eq(file_data)
37
+ end
38
+ end
29
39
 
30
- it "gets format and dimensions of #{name} given as data" do
31
- is = ImageSize.new(data)
32
- expect([is.format, is.width, is.height]).to eq([format, width, height])
33
- end
40
+ context 'given as IO' do
41
+ it 'gets format and dimensions' do
42
+ File.open(path, 'rb') do |io|
43
+ image_size = ImageSize.new(io)
44
+ expect(image_size).to have_attributes(attributes)
45
+ expect(io).not_to be_closed
46
+ expect(io.pos).to_not be_zero
47
+ io.rewind
48
+ expect(io.read).to eq(file_data)
49
+ end
50
+ end
51
+ end
34
52
 
35
- it "gets format and dimensions of #{name} given as Tempfile" do
36
- Tempfile.open(name) do |tf|
37
- tf.binmode
38
- tf.write(data)
39
- tf.rewind
40
- is = ImageSize.new(tf)
41
- expect([is.format, is.width, is.height]).to eq([format, width, height])
42
- expect(tf).not_to be_closed
43
- tf.rewind
44
- expect(tf.read).to eq(data)
53
+ context 'given as StringIO' do
54
+ it 'gets format and dimensions' do
55
+ io = StringIO.new(file_data)
56
+ image_size = ImageSize.new(io)
57
+ expect(image_size).to have_attributes(attributes)
58
+ expect(io).not_to be_closed
59
+ expect(io.pos).to_not be_zero
60
+ io.rewind
61
+ expect(io.read).to eq(file_data)
62
+ end
45
63
  end
46
- end
47
64
 
48
- it "gets format and dimensions of #{name} given as IO when run twice" do
49
- File.open(path, 'rb') do |fh|
50
- is = ImageSize.new(fh)
51
- expect([is.format, is.width, is.height]).to eq([format, width, height])
52
- is = ImageSize.new(fh)
53
- expect([is.format, is.width, is.height]).to eq([format, width, height])
65
+ context 'given as Tempfile' do
66
+ it 'gets format and dimensions' do
67
+ Tempfile.open(name) do |io|
68
+ io.binmode
69
+ io.write(file_data)
70
+ io.rewind
71
+ image_size = ImageSize.new(io)
72
+ expect(image_size).to have_attributes(attributes)
73
+ expect(io).not_to be_closed
74
+ expect(io.pos).to_not be_zero
75
+ io.rewind
76
+ expect(io.read).to eq(file_data)
77
+ end
78
+ end
54
79
  end
55
- end
56
80
 
57
- it "gets format and dimensions of #{name} as path" do
58
- is = ImageSize.path(path)
59
- expect([is.format, is.width, is.height]).to eq([format, width, height])
81
+ context 'using path method' do
82
+ it 'gets format and dimensions' do
83
+ image_size = ImageSize.path(path)
84
+ expect(image_size).to have_attributes(attributes)
85
+ end
86
+ end
60
87
  end
61
88
  end
62
89
 
63
- it "raises ArgumentError if argument is not valid" do
64
- expect {
90
+ it 'raises ArgumentError if argument is not valid' do
91
+ expect do
65
92
  ImageSize.new(Object)
66
- }.to raise_error(ArgumentError)
93
+ end.to raise_error(ArgumentError)
67
94
  end
68
95
 
69
96
  {
@@ -71,9 +98,9 @@ describe ImageSize do
71
98
  :jpeg => "\377\330",
72
99
  }.each do |type, data|
73
100
  it "raises FormatError if invalid #{type} given" do
74
- expect {
101
+ expect do
75
102
  ImageSize.new(data)
76
- }.to raise_error(ImageSize::FormatError)
103
+ end.to raise_error(ImageSize::FormatError)
77
104
  end
78
105
  end
79
106
  end
Binary file
Binary file
Binary file
Binary file
Binary file
Binary file
Binary file
File without changes
@@ -0,0 +1,8 @@
1
+ P7
2
+ WIDTH 22
3
+ HEIGHT 25
4
+ DEPTH 3
5
+ MAXVAL 255
6
+ TUPLTYPE RGB
7
+ ENDHDR
8
+ JMRGJONQVKNSRVZY^b{��|��osyz����Ǎ��v|�������UY_ORT�^_�ts�_b`FH�`aDGLHJPJMQfjnflplqu}�����u{�������nsw[`d]bgqv}aej>AFLLO�`c�ro�bdxORlsvZ_ccknS[^imrwz��������������ɑ��UY]���u{~��glosz~X^b�_^�li�lk���dimORWORWRUZY\a������������������UW\������]`ehmqOPU>AHfOR�lj�kjv}�KNSKOREILEIMTX[LQUAEJHJOZ]a_di���muz������=<BSUZrv|���}pt�jh�liPWZGJOIMPEILDHK=AE`eiuz~������}��������������XZ_MMR[^e�������ed�heHKPPSWFKNAFIMRV`hk���������nuxW\`V[_CHLu|����[^dBBGDHMBEJomr�hf�geJMSZ\aDILekn������dimPUYMNSBBGCDIFGLDEJ]`f���chlDGLT\^EMQ]MQ�ji�ecoehXadJMR���Y]a_afcdjORWKNTMTYJNRFFICCG]`d���z�==BFGLAEK�VX�ki�ec�nrLQWNSZdjmkqtBBHABGPX]^ltScgIMPCDHJJNQTX�����JKPPSX_^d�__�jf�ca�st�_bjX[jsw���^eh=@EIPUQX^RW\UY]JNR@AEegn���v{FFLmuy�]_�ec�gd�ca�zx�zx�po�cg~����y��YZ^CEIEGKSUZejnMRUZ]b���osxADIm[_�_`�ca�ec�db�st�|}�zy�vt�gh�ot�����Ϣ��ehlEGLX]`PRVX[_���dek7<@�RT�b_�a_�`^�ca�ux�{~�|z�yv�{w�rp�ii�����������ntwDDIgjn���`cjSSW�^^�gd�b`�`^�b`�yv�wx�xu�|x�yu�vs�vs�oo�ii�km������FHMimq���QX_x`d�fe�fb�da�b`�ca�wu�rp�vt�us�tr�vs�ts�sr�po�uv�ml�x|V[_gin���OU[�Z\�fc�ea�db�ca�b`�zx�tq�vt�us�wt�vs�wt�sq�rr�st�sq�giTX\SVZ���fbg�ce�eb�ca�ec�db�ec�yu�ur�sq�sr�vs�xu�xs�tq�xt�ws�xt�ihKMRchm���]NP�ge�eb�ca�db�ec�fd�zv�sq�rq�sr�rp�xu�so�rp�tq�qn�uq�bcHIN\bgo|�wQU�jh�fd�ca�b`�ca�ec�zy�xt�tr�vs�sr�sr�tq�sp�rp�kj�mk�^^HLPLOTfqv�UV�jf�ec�db�b`�cb�ca�ss�{w�us�tr�ur�wt�tq�qo�ro�lj�on�ZZ=BFNNTRZ_�YY�ie�db�db�`_�_^�`_�ij�~|�vs�ur�sq�pn�qo�ol�ji�mj�qn�Z]CFL]_dLIN�aa�fb�ca�cb�a`�__�]^x_^�{x�ws�wt�sp�pn�po�lknZ^�lk�pmxXYDINkrwkUX�mj�db�fdX[�Y\�`_�]]�gi�vs�us�xu�tr�nk�lj�nk�jj�mk�kjlPR?CGGIP�bb�pm�fd�da�Y\�]]�b_�`_�ru�ml�ur�wu�tr�pk�lg�oi�oj�pl�kiaMO;@EPGI�kj�he�fd�fc�b`�a^�b`�_^
Binary file
@@ -0,0 +1,4 @@
1
+ P5
2
+ 22 25
3
+ 255
4
+ MJQNU]��sÑ{��YRh�mLmGJMikp��z��r_aueALi�rXr^jZmz����ŗX�z�ky]k��hRRU\������W��`lPAT~|NNHHWPEJ]c�t��=Uv�s|VJLHG@dy�������ZM^��v|KSJEQg���t[ZG{�^BHEnx{M\Hj��hTNBDGE`�gGZLQ}yg_M�\adRNSMFC`�~=GE_yzPRipBBWj`LDJT��KS_n~w�i\q�d@OWVXMAg�zFtgz{w���j��ZEGUiQ]�sD_rwyx|���ss�ͩhG\R[�e;]wutw������u����sDj�cSm{vtv��������{w��Hl�We{zxvw����������~{Zi�Te{yxwv�����������qWV�ctywyxy�����������rMg�Qzywxyz�����������lIazY~zwvwy���������~�gKOo_yxvww~���������cANYe~xxutup�������w�cF_Jq{wxvtsd������x_�_HqZ�xzahvrm�����{�~VBIl�zweowu{{�������~Q?I||zzwuvt
@@ -0,0 +1,4 @@
1
+ P6
2
+ 22 25
3
+ 255
4
+ JMRGJONQVKNSRVZY^b{��|��osyz����Ǎ��v|�������UY_ORT�^_�ts�_b`FH�`aDGLHJPJMQfjnflplqu}�����u{�������nsw[`d]bgqv}aej>AFLLO�`c�ro�bdxORlsvZ_ccknS[^imrwz��������������ɑ��UY]���u{~��glosz~X^b�_^�li�lk���dimORWORWRUZY\a������������������UW\������]`ehmqOPU>AHfOR�lj�kjv}�KNSKOREILEIMTX[LQUAEJHJOZ]a_di���muz������=<BSUZrv|���}pt�jh�liPWZGJOIMPEILDHK=AE`eiuz~������}��������������XZ_MMR[^e�������ed�heHKPPSWFKNAFIMRV`hk���������nuxW\`V[_CHLu|����[^dBBGDHMBEJomr�hf�geJMSZ\aDILekn������dimPUYMNSBBGCDIFGLDEJ]`f���chlDGLT\^EMQ]MQ�ji�ecoehXadJMR���Y]a_afcdjORWKNTMTYJNRFFICCG]`d���z�==BFGLAEK�VX�ki�ec�nrLQWNSZdjmkqtBBHABGPX]^ltScgIMPCDHJJNQTX�����JKPPSX_^d�__�jf�ca�st�_bjX[jsw���^eh=@EIPUQX^RW\UY]JNR@AEegn���v{FFLmuy�]_�ec�gd�ca�zx�zx�po�cg~����y��YZ^CEIEGKSUZejnMRUZ]b���osxADIm[_�_`�ca�ec�db�st�|}�zy�vt�gh�ot�����Ϣ��ehlEGLX]`PRVX[_���dek7<@�RT�b_�a_�`^�ca�ux�{~�|z�yv�{w�rp�ii�����������ntwDDIgjn���`cjSSW�^^�gd�b`�`^�b`�yv�wx�xu�|x�yu�vs�vs�oo�ii�km������FHMimq���QX_x`d�fe�fb�da�b`�ca�wu�rp�vt�us�tr�vs�ts�sr�po�uv�ml�x|V[_gin���OU[�Z\�fc�ea�db�ca�b`�zx�tq�vt�us�wt�vs�wt�sq�rr�st�sq�giTX\SVZ���fbg�ce�eb�ca�ec�db�ec�yu�ur�sq�sr�vs�xu�xs�tq�xt�ws�xt�ihKMRchm���]NP�ge�eb�ca�db�ec�fd�zv�sq�rq�sr�rp�xu�so�rp�tq�qn�uq�bcHIN\bgo|�wQU�jh�fd�ca�b`�ca�ec�zy�xt�tr�vs�sr�sr�tq�sp�rp�kj�mk�^^HLPLOTfqv�UV�jf�ec�db�b`�cb�ca�ss�{w�us�tr�ur�wt�tq�qo�ro�lj�on�ZZ=BFNNTRZ_�YY�ie�db�db�`_�_^�`_�ij�~|�vs�ur�sq�pn�qo�ol�ji�mj�qn�Z]CFL]_dLIN�aa�fb�ca�cb�a`�__�]^x_^�{x�ws�wt�sp�pn�po�lknZ^�lk�pmxXYDINkrwkUX�mj�db�fdX[�Y\�`_�]]�gi�vs�us�xu�tr�nk�lj�nk�jj�mk�kjlPR?CGGIP�bb�pm�fd�da�Y\�]]�b_�`_�ru�ml�ur�wu�tr�pk�lg�oi�oj�pl�kiaMO;@EPGI�kj�he�fd�fc�b`�a^�b`�_^
@@ -0,0 +1,27 @@
1
+ P1
2
+ 22 25
3
+ 1 1 1 1 1 1 1 0 1 0 0 0 0 0 0 1 1 1 1 1 1 1
4
+ 1 1 1 1 1 1 0 0 1 0 0 0 0 1 0 1 1 1 1 1 1 1
5
+ 1 1 1 1 1 1 0 0 0 0 0 0 1 0 1 0 1 1 1 1 1 0
6
+ 1 1 1 1 1 1 0 0 0 0 0 0 1 0 0 1 1 1 1 1 0 1
7
+ 1 1 1 1 1 1 1 1 1 1 1 0 1 0 0 1 1 1 1 1 1 0
8
+ 1 1 1 1 1 1 1 1 0 0 1 1 0 0 0 1 1 1 0 0 1 1
9
+ 1 1 1 1 1 1 0 0 0 1 1 1 1 0 0 1 1 1 1 1 0 1
10
+ 1 1 1 1 1 1 1 1 1 1 1 1 1 1 0 1 1 1 1 1 1 0
11
+ 1 1 1 0 1 1 1 1 1 1 1 1 1 1 0 1 1 1 1 1 1 1
12
+ 1 1 1 1 1 1 1 1 1 1 1 1 1 1 0 1 1 1 1 1 1 1
13
+ 1 1 1 1 1 1 1 1 1 1 1 1 1 1 0 0 1 1 1 0 0 0
14
+ 0 1 0 1 1 0 0 0 1 1 1 1 1 0 0 0 1 1 1 1 1 1
15
+ 1 0 0 0 1 1 0 0 0 1 1 1 1 1 0 1 1 1 1 1 0 1
16
+ 0 0 1 0 0 0 1 0 0 0 1 1 1 1 0 1 1 1 1 1 1 1
17
+ 0 0 0 0 0 0 0 1 0 0 0 0 1 0 0 1 1 1 0 1 1 0
18
+ 0 0 1 0 1 0 0 0 1 0 1 1 1 1 0 1 1 0 1 0 1 1
19
+ 1 0 0 1 0 1 0 0 1 0 0 1 1 1 0 1 1 1 0 1 1 0
20
+ 0 0 0 0 0 0 0 1 0 0 0 1 1 1 1 1 1 0 1 0 0 1
21
+ 1 0 1 1 0 1 0 1 0 1 0 1 1 1 1 1 0 1 1 1 0 1
22
+ 0 0 0 0 0 0 0 0 0 1 0 1 1 1 1 1 1 0 0 1 1 1
23
+ 1 0 0 1 1 0 1 0 0 1 0 1 1 1 1 1 1 0 0 1 1 1
24
+ 1 0 0 0 0 0 0 1 0 1 1 1 1 1 1 1 0 1 1 1 0 1
25
+ 1 0 0 0 0 1 0 1 1 0 1 1 1 1 1 0 1 0 1 1 1 1
26
+ 1 0 1 0 0 0 1 0 1 1 1 1 1 1 1 1 0 1 1 1 0 0
27
+ 1 0 0 1 0 0 1 0 1 0 1 1 1 1 1 1 1 1 0 1 1 0
@@ -0,0 +1,28 @@
1
+ P2
2
+ 22 25
3
+ 255
4
+ 77 74 81 78 85 93 129 129 115 127 195 145 123 169 147 89 82 104 135 109 76 109
5
+ 71 74 77 105 107 112 132 169 122 151 204 114 95 97 117 101 65 76 105 133 114 88
6
+ 114 94 106 90 109 122 165 164 178 187 197 151 88 134 122 130 107 121 93 107 128 127
7
+ 158 104 82 82 85 92 144 155 154 180 157 183 87 182 145 96 108 80 65 84 127 126
8
+ 124 78 78 72 72 87 80 69 74 93 99 157 116 160 139 61 85 118 141 115 124 127
9
+ 86 74 76 72 71 64 100 121 139 170 132 142 154 182 160 90 77 94 142 145 118 124
10
+ 75 83 74 69 81 103 137 170 158 116 91 90 71 123 173 94 66 72 69 110 120 123
11
+ 77 92 72 106 138 140 104 84 78 66 68 71 69 96 161 103 71 90 76 81 125 121
12
+ 103 95 77 134 92 97 100 82 78 83 77 70 67 96 185 126 61 71 69 95 127 121
13
+ 122 80 82 105 112 66 66 87 106 96 76 68 74 84 180 130 75 83 95 110 126 119
14
+ 131 105 92 113 140 100 64 79 87 86 88 77 65 103 189 122 70 116 103 122 123 119
15
+ 138 138 128 106 127 158 128 90 69 71 85 105 81 93 191 115 68 95 114 119 121 120
16
+ 124 142 140 137 115 115 168 205 169 104 71 92 82 91 185 101 59 93 119 117 116 119
17
+ 131 140 140 138 140 131 117 132 146 166 148 115 68 106 192 99 83 109 123 118 116 118
18
+ 138 137 137 140 138 135 136 129 123 119 138 140 72 108 178 87 101 123 122 120 118 119
19
+ 136 132 136 135 134 135 134 134 128 133 126 123 90 105 177 84 101 123 121 120 119 118
20
+ 138 134 136 135 136 135 136 133 131 132 134 113 87 86 163 99 116 121 119 121 120 121
21
+ 137 134 133 133 135 137 137 134 137 136 138 114 77 103 147 81 122 121 119 120 121 122
22
+ 139 133 132 132 129 137 132 132 134 131 135 108 73 97 122 89 126 122 119 118 119 121
23
+ 137 137 134 135 133 133 134 133 132 126 129 103 75 79 111 95 127 121 120 118 119 119
24
+ 126 140 135 134 134 136 134 131 133 127 131 99 65 78 89 101 126 120 120 117 116 117
25
+ 112 143 135 134 133 130 132 129 119 127 133 99 70 95 74 113 123 119 120 118 116 115
26
+ 100 139 136 136 133 131 132 120 95 127 132 95 72 113 90 128 120 122 97 104 118 114
27
+ 109 133 135 137 134 128 127 127 123 128 126 86 66 73 108 131 122 119 101 111 119 117
28
+ 123 123 135 136 134 130 127 129 129 130 126 81 63 73 124 124 122 122 119 117 118 116
@@ -0,0 +1,28 @@
1
+ P3
2
+ 22 25
3
+ 255
4
+ 74 77 82 71 74 79 78 81 86 75 78 83 82 86 90 89 94 98 123 130 133 124 130 134 111 115 121 122 128 133 189 196 199 141 146 149 118 124 128 162 170 173 141 148 152 85 89 95 79 82 84 141 94 95 205 116 115 162 95 98 96 70 72 156 96 97
5
+ 68 71 76 72 74 80 74 77 81 102 106 110 102 108 112 108 113 117 125 133 136 161 171 173 117 123 128 144 152 157 197 206 209 110 115 119 91 96 100 93 98 103 113 118 125 97 101 106 62 65 70 76 76 79 139 96 99 205 114 111 173 98 100 120 79 82
6
+ 108 115 118 90 95 99 99 107 110 83 91 94 105 109 114 119 122 127 158 166 169 156 166 167 170 180 181 180 188 191 190 198 201 145 153 155 85 89 93 129 135 138 117 123 127 126 131 136 103 108 111 115 122 126 88 94 98 150 95 94 205 108 105 200 108 107
7
+ 151 159 162 100 105 109 79 82 87 79 82 87 82 85 90 89 92 97 138 145 148 149 156 160 149 155 159 175 181 185 150 159 162 176 184 188 85 87 92 177 183 185 139 146 149 93 96 101 104 109 113 79 80 85 62 65 72 102 79 82 199 108 106 198 107 106
8
+ 118 125 128 75 78 83 75 79 82 69 73 76 69 73 77 84 88 91 76 81 85 65 69 74 72 74 79 90 93 97 95 100 105 151 158 164 109 117 122 154 161 164 137 139 144 61 60 66 83 85 90 114 118 124 133 143 149 125 112 116 192 106 104 199 108 105
9
+ 80 87 90 71 74 79 73 77 80 69 73 76 68 72 75 61 65 69 96 101 105 117 122 126 134 140 143 166 171 175 125 133 137 135 143 149 148 155 161 176 183 189 156 160 167 88 90 95 77 77 82 91 94 101 135 143 149 144 145 147 179 101 100 199 104 101
10
+ 72 75 80 80 83 87 70 75 78 65 70 73 77 82 86 96 104 107 130 138 141 163 171 174 151 159 162 110 117 120 87 92 96 86 91 95 67 72 76 117 124 131 166 174 183 91 94 100 66 66 71 68 72 77 66 69 74 111 109 114 179 104 102 200 103 101
11
+ 74 77 83 90 92 97 68 73 76 101 107 110 131 139 142 136 141 145 100 105 109 80 85 89 77 78 83 66 66 71 67 68 73 70 71 76 68 69 74 93 96 102 153 163 167 99 104 108 68 71 76 84 92 94 69 77 81 93 77 81 194 106 105 196 101 99
12
+ 111 101 104 88 97 100 74 77 82 128 135 139 89 93 97 95 97 102 99 100 106 79 82 87 75 78 84 77 84 89 74 78 82 70 70 73 67 67 71 93 96 100 177 187 188 122 127 131 61 61 66 70 71 76 65 69 75 129 86 88 204 107 105 196 101 99
13
+ 164 110 114 76 81 87 78 83 90 100 106 109 107 113 116 66 66 72 65 66 71 80 88 93 94 108 116 83 99 103 73 77 80 67 68 72 74 74 78 81 84 88 172 182 185 127 131 135 74 75 80 80 83 88 95 94 100 167 95 95 203 106 102 193 99 97
14
+ 188 115 116 139 95 98 106 88 91 106 115 119 131 142 144 94 101 104 61 64 69 73 80 85 81 88 94 82 87 92 85 89 93 74 78 82 64 65 69 101 103 110 182 190 196 118 123 127 70 70 76 109 117 121 137 93 95 199 101 99 197 103 100 194 99 97
15
+ 200 122 120 199 122 120 188 112 111 132 99 103 126 127 131 151 159 164 121 129 132 89 90 94 67 69 73 69 71 75 83 85 90 101 106 110 77 82 85 90 93 98 184 193 198 111 115 120 65 68 73 109 91 95 184 95 96 195 99 97 195 101 99 195 100 98
16
+ 159 115 116 207 124 125 205 122 121 206 118 116 159 103 104 130 111 116 170 167 171 197 207 207 162 171 174 101 104 108 69 71 76 88 93 96 80 82 86 88 91 95 178 187 192 100 101 107 55 60 64 133 82 84 197 98 95 191 97 95 191 96 94 194 99 97
17
+ 183 117 120 204 123 126 202 124 122 202 121 118 206 123 119 194 114 112 163 105 105 152 127 129 156 143 146 162 167 170 140 150 154 110 116 119 68 68 73 103 106 110 184 194 199 96 99 106 83 83 87 163 94 94 200 103 100 192 98 96 191 96 94 193 98 96
18
+ 204 121 118 201 119 120 201 120 117 202 124 120 200 121 117 201 118 115 204 118 115 197 111 111 189 105 105 165 107 109 150 135 138 132 142 148 70 72 77 105 109 113 169 180 185 81 88 95 120 96 100 199 102 101 198 102 98 194 100 97 193 98 96 194 99 97
19
+ 201 119 117 200 114 112 201 118 116 202 117 115 201 116 114 201 118 115 200 116 115 203 115 114 189 112 111 194 117 118 189 109 108 133 120 124 86 91 95 103 105 110 170 179 183 79 85 91 140 90 92 203 102 99 195 101 97 195 100 98 194 99 97 192 98 96
20
+ 200 122 120 201 116 113 202 118 116 201 117 115 200 119 116 199 118 115 201 119 116 202 115 113 193 114 114 193 115 116 206 115 113 147 103 105 84 88 92 83 86 90 153 165 167 102 98 103 176 99 101 198 101 98 194 99 97 196 101 99 195 100 98 195 101 99
21
+ 199 121 117 200 117 114 200 115 113 200 115 114 200 118 115 200 120 117 200 120 115 200 116 113 201 120 116 200 119 115 206 120 116 150 105 104 75 77 82 99 104 109 138 149 154 93 78 80 193 103 101 197 101 98 194 99 97 195 100 98 196 101 99 196 102 100
22
+ 202 122 118 199 115 113 201 114 113 196 115 114 187 114 112 200 120 117 198 115 111 200 114 112 201 116 113 198 113 110 204 117 113 143 98 99 72 73 78 92 98 103 111 124 129 119 81 85 202 106 104 198 102 100 194 99 97 193 98 96 194 99 97 195 101 99
23
+ 195 122 121 202 120 116 201 116 114 200 118 115 198 115 114 201 115 114 200 116 113 200 115 112 201 114 112 198 107 106 203 109 107 137 94 94 72 76 80 76 79 84 102 113 118 133 85 86 204 106 102 196 101 99 195 100 98 194 98 96 195 99 98 194 99 97
24
+ 167 115 115 206 123 119 200 117 115 201 116 114 200 117 114 201 119 116 201 116 113 199 113 111 205 114 111 199 108 106 205 111 110 132 90 90 61 66 70 78 78 84 82 90 95 147 89 89 204 105 101 196 100 98 195 100 98 194 96 95 195 95 94 195 96 95
25
+ 137 105 106 208 126 124 200 118 115 199 117 114 201 115 113 199 112 110 201 113 111 196 111 108 166 106 105 193 109 106 207 113 110 130 90 93 67 70 76 93 95 100 76 73 78 170 97 97 201 102 98 195 99 97 197 99 98 194 97 96 195 95 95 194 93 94
26
+ 120 95 94 201 123 120 200 119 115 199 119 116 199 115 112 200 112 110 205 112 111 167 108 107 110 90 94 198 108 107 205 112 109 120 88 89 68 73 78 107 114 119 107 85 88 199 109 106 196 100 98 196 102 100 127 88 91 158 89 92 199 96 95 193 93 93
27
+ 132 103 105 188 118 115 201 117 115 200 120 117 200 116 114 198 110 107 199 108 106 189 110 107 188 106 106 200 109 107 198 107 106 108 80 82 63 67 71 71 73 80 146 98 98 204 112 109 198 102 100 190 100 97 144 89 92 176 93 93 196 98 95 194 96 95
28
+ 154 114 117 176 109 108 203 117 114 201 119 117 201 116 114 199 112 107 198 108 103 197 111 105 199 111 106 199 112 108 196 107 105 97 77 79 59 64 69 80 71 73 188 107 106 197 104 101 196 102 100 195 102 99 199 98 96 194 97 94 193 98 96 194 95 94
metadata CHANGED
@@ -1,114 +1,153 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: image_size
3
3
  version: !ruby/object:Gem::Version
4
- version: 1.5.0
4
+ version: 2.1.1
5
5
  platform: ruby
6
6
  authors:
7
7
  - Keisuke Minami
8
8
  - Ivan Kuchin
9
- autorequire:
9
+ autorequire:
10
10
  bindir: bin
11
11
  cert_chain: []
12
- date: 2016-11-20 00:00:00.000000000 Z
12
+ date: 2021-07-04 00:00:00.000000000 Z
13
13
  dependencies:
14
14
  - !ruby/object:Gem::Dependency
15
15
  name: rspec
16
16
  requirement: !ruby/object:Gem::Requirement
17
17
  requirements:
18
- - - ~>
18
+ - - "~>"
19
19
  - !ruby/object:Gem::Version
20
20
  version: '3.0'
21
21
  type: :development
22
22
  prerelease: false
23
23
  version_requirements: !ruby/object:Gem::Requirement
24
24
  requirements:
25
- - - ~>
25
+ - - "~>"
26
26
  - !ruby/object:Gem::Version
27
27
  version: '3.0'
28
- description: ! 'Measure following file dimensions: apng, bmp, cur, gif, jpeg, ico,
29
- mng, pbm, pcx, pgm, png, ppm, psd, swf, tiff, xbm, xpm, webp'
30
- email:
28
+ - !ruby/object:Gem::Dependency
29
+ name: rubocop
30
+ requirement: !ruby/object:Gem::Requirement
31
+ requirements:
32
+ - - "~>"
33
+ - !ruby/object:Gem::Version
34
+ version: '1.0'
35
+ type: :development
36
+ prerelease: false
37
+ version_requirements: !ruby/object:Gem::Requirement
38
+ requirements:
39
+ - - "~>"
40
+ - !ruby/object:Gem::Version
41
+ version: '1.0'
42
+ description: 'Measure following file dimensions: apng, bmp, cur, gif, ico, j2c, jp2,
43
+ jpeg, jpx, mng, pam, pbm, pcx, pgm, png, ppm, psd, svg, swf, tiff, webp, xbm, xpm'
44
+ email:
31
45
  executables: []
32
46
  extensions: []
33
47
  extra_rdoc_files: []
34
48
  files:
35
- - .gitignore
36
- - .travis.yml
49
+ - ".github/workflows/check.yml"
50
+ - ".gitignore"
51
+ - ".rubocop.yml"
52
+ - ".rubocop_todo.yml"
53
+ - CHANGELOG.markdown
54
+ - GPL
37
55
  - Gemfile
56
+ - LICENSE.txt
38
57
  - README.markdown
39
58
  - image_size.gemspec
40
59
  - lib/image_size.rb
41
60
  - spec/image_size_spec.rb
42
- - spec/images/apng/192x110.apng
43
61
  - spec/images/bmp/v2.42x50.bmp
44
62
  - spec/images/bmp/v3-bottom2top.42x50.bmp
45
63
  - spec/images/bmp/v3-top2bottom.42x50.bmp
46
- - spec/images/cur/50x256.cur
64
+ - spec/images/cur/32x256.cur
47
65
  - spec/images/gif/668x481.gif
48
- - spec/images/ico/256x27.ico
49
- - spec/images/jpeg/320x240.jpeg
50
- - spec/images/jpeg/extraneous-bytes.320x240.jpeg
51
- - spec/images/mng/612x132.mng
52
- - spec/images/pbm/85x55.pbm
66
+ - spec/images/ico/32x256.ico
67
+ - spec/images/jp2/163x402.jp2
68
+ - spec/images/jp2/176x373.jpx
69
+ - spec/images/jp2/224x293.j2c
70
+ - spec/images/jpeg/436x429.jpeg
71
+ - spec/images/jpeg/extraneous-bytes.436x429.jpeg
72
+ - spec/images/mng/61x42.mng
53
73
  - spec/images/pcx/70x60.pcx
54
- - spec/images/pgm/90x55.pgm
74
+ - spec/images/png/192x110.apng
55
75
  - spec/images/png/640x532.png
76
+ - spec/images/pnm/22x25.pam
77
+ - spec/images/pnm/22x25.pbm
78
+ - spec/images/pnm/22x25.pgm
79
+ - spec/images/pnm/22x25.ppm
80
+ - spec/images/pnm/ascii.22x25.pbm
81
+ - spec/images/pnm/ascii.22x25.pgm
82
+ - spec/images/pnm/ascii.22x25.ppm
56
83
  - spec/images/psd/16x20.psd
57
84
  - spec/images/svg/72x100.svg
58
85
  - spec/images/swf/450x200.swf
59
- - spec/images/tiff/48x64.tiff
86
+ - spec/images/tiff/big-endian.68x49.tiff
87
+ - spec/images/tiff/little-endian.40x68.tiff
60
88
  - spec/images/webp/extended.16x32.webp
61
89
  - spec/images/webp/lossless.16x32.webp
62
90
  - spec/images/webp/lossy.16x32.webp
63
91
  - spec/images/xbm/16x32.xbm
64
92
  - spec/images/xpm/24x32.xpm
65
- homepage: http://github.com/toy/image_size
93
+ homepage: https://github.com/toy/image_size
66
94
  licenses:
67
95
  - Ruby
68
- metadata: {}
69
- post_install_message:
96
+ metadata:
97
+ bug_tracker_uri: https://github.com/toy/image_size/issues
98
+ changelog_uri: https://github.com/toy/image_size/blob/master/CHANGELOG.markdown
99
+ documentation_uri: https://www.rubydoc.info/gems/image_size/2.1.1
100
+ source_code_uri: https://github.com/toy/image_size
101
+ post_install_message:
70
102
  rdoc_options: []
71
103
  require_paths:
72
104
  - lib
73
105
  required_ruby_version: !ruby/object:Gem::Requirement
74
106
  requirements:
75
- - - ! '>='
107
+ - - ">="
76
108
  - !ruby/object:Gem::Version
77
109
  version: '0'
78
110
  required_rubygems_version: !ruby/object:Gem::Requirement
79
111
  requirements:
80
- - - ! '>='
112
+ - - ">="
81
113
  - !ruby/object:Gem::Version
82
114
  version: '0'
83
115
  requirements: []
84
- rubyforge_project: image_size
85
- rubygems_version: 2.6.4
86
- signing_key:
116
+ rubygems_version: 3.2.16
117
+ signing_key:
87
118
  specification_version: 4
88
119
  summary: Measure image size using pure Ruby
89
120
  test_files:
90
121
  - spec/image_size_spec.rb
91
- - spec/images/apng/192x110.apng
92
122
  - spec/images/bmp/v2.42x50.bmp
93
123
  - spec/images/bmp/v3-bottom2top.42x50.bmp
94
124
  - spec/images/bmp/v3-top2bottom.42x50.bmp
95
- - spec/images/cur/50x256.cur
125
+ - spec/images/cur/32x256.cur
96
126
  - spec/images/gif/668x481.gif
97
- - spec/images/ico/256x27.ico
98
- - spec/images/jpeg/320x240.jpeg
99
- - spec/images/jpeg/extraneous-bytes.320x240.jpeg
100
- - spec/images/mng/612x132.mng
101
- - spec/images/pbm/85x55.pbm
127
+ - spec/images/ico/32x256.ico
128
+ - spec/images/jp2/163x402.jp2
129
+ - spec/images/jp2/176x373.jpx
130
+ - spec/images/jp2/224x293.j2c
131
+ - spec/images/jpeg/436x429.jpeg
132
+ - spec/images/jpeg/extraneous-bytes.436x429.jpeg
133
+ - spec/images/mng/61x42.mng
102
134
  - spec/images/pcx/70x60.pcx
103
- - spec/images/pgm/90x55.pgm
135
+ - spec/images/png/192x110.apng
104
136
  - spec/images/png/640x532.png
137
+ - spec/images/pnm/22x25.pam
138
+ - spec/images/pnm/22x25.pbm
139
+ - spec/images/pnm/22x25.pgm
140
+ - spec/images/pnm/22x25.ppm
141
+ - spec/images/pnm/ascii.22x25.pbm
142
+ - spec/images/pnm/ascii.22x25.pgm
143
+ - spec/images/pnm/ascii.22x25.ppm
105
144
  - spec/images/psd/16x20.psd
106
145
  - spec/images/svg/72x100.svg
107
146
  - spec/images/swf/450x200.swf
108
- - spec/images/tiff/48x64.tiff
147
+ - spec/images/tiff/big-endian.68x49.tiff
148
+ - spec/images/tiff/little-endian.40x68.tiff
109
149
  - spec/images/webp/extended.16x32.webp
110
150
  - spec/images/webp/lossless.16x32.webp
111
151
  - spec/images/webp/lossy.16x32.webp
112
152
  - spec/images/xbm/16x32.xbm
113
153
  - spec/images/xpm/24x32.xpm
114
- has_rdoc: