lib/iiif_url.rb in iiif_url-0.0.3 vs lib/iiif_url.rb in iiif_url-0.0.4
- old
+ new
@@ -110,10 +110,14 @@
end
size_string = url_parts.pop
size = if size_string.include?(',')
w, h = size_string.split(',')
- w = w.to_i if !w.nil?
+ w = if w.empty?
+ nil
+ else
+ w.to_i
+ end
h = h.to_i if !h.nil?
{w: w, h: h}
elsif size_string.include?('pct')
pct, size = size_string.split(':')
{pct: size.to_f}