Merge pull request #4484 from lllusion3469/fix-flash-dimensions
Fix flash dimensions
This commit is contained in:
@@ -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
|
||||||
|
|||||||
Reference in New Issue
Block a user