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 def dimensions
# Read the entire stream into memory because the # Read the entire stream into memory because the
# dimensions aren't stored in a standard location # 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 # Our 'signature' is the first 3 bytes
# Either FWS or CWS. CWS indicates compression # Either FWS or CWS. CWS indicates compression
@@ -54,4 +54,5 @@ class MediaFile::Flash < MediaFile
[width, height] [width, height]
end end
memoize :dimensions
end end