Merge pull request #4484 from lllusion3469/fix-flash-dimensions

Fix flash dimensions
This commit is contained in:
evazion
2020-05-27 14:10:51 -05:00
committed by GitHub

View File

@@ -5,7 +5,7 @@ class MediaFile::Flash < MediaFile
def dimensions
# Read the entire stream into memory because the
# dimensions aren't stored in a standard location
contents = file.read.force_encoding("ASCII-8BIT")
contents = File.read(file.path, binmode: true).force_encoding("ASCII-8BIT")
# Our 'signature' is the first 3 bytes
# Either FWS or CWS. CWS indicates compression
@@ -54,4 +54,5 @@ class MediaFile::Flash < MediaFile
[width, height]
end
memoize :dimensions
end