about summary refs log tree commit diff
path: root/lib/paperclip/gif_transcoder.rb
diff options
context:
space:
mode:
authorClaire <claire.github-309c@sitedethib.com>2023-02-26 15:06:03 +0100
committerGitHub <noreply@github.com>2023-02-26 15:06:03 +0100
commit6a4be4e96677eb3e1303ddcab8f8b4bea7298453 (patch)
tree52627bf6dd64b0a33e280442b2de60b4e802a544 /lib/paperclip/gif_transcoder.rb
parent45087c1092143e95dfcc85b6c9abc5c6c0a0a5c2 (diff)
parentb91756fd4d475edff890e460c44b3a7245ad51e2 (diff)
Merge pull request #2119 from ClearlyClaire/glitch-soc/merge-upstream
Merge upstream changes
Diffstat (limited to 'lib/paperclip/gif_transcoder.rb')
-rw-r--r--lib/paperclip/gif_transcoder.rb6
1 files changed, 3 insertions, 3 deletions
diff --git a/lib/paperclip/gif_transcoder.rb b/lib/paperclip/gif_transcoder.rb
index d14465c01..32bdb8a86 100644
--- a/lib/paperclip/gif_transcoder.rb
+++ b/lib/paperclip/gif_transcoder.rb
@@ -57,7 +57,7 @@ class GifReader
           end
 
           # Skip lzw min code size
-          raise InvalidValue unless s.read(1).unpack('C')[0] >= 2
+          raise InvalidValue unless s.read(1).unpack1('C') >= 2
 
           # Skip image data sub-blocks
           skip_sub_blocks!(s)
@@ -77,7 +77,7 @@ class GifReader
   private
 
   def skip_extension_block!(file)
-    if EXTENSION_LABELS.include?(file.read(1).unpack('C')[0])
+    if EXTENSION_LABELS.include?(file.read(1).unpack1('C'))
       block_size, = file.read(1).unpack('C')
       file.seek(block_size, IO::SEEK_CUR)
     end
@@ -109,7 +109,7 @@ module Paperclip
       final_file = Paperclip::Transcoder.make(file, options, attachment)
 
       if options[:style] == :original
-        attachment.instance.file_file_name    = File.basename(attachment.instance.file_file_name, '.*') + '.mp4'
+        attachment.instance.file_file_name    = "#{File.basename(attachment.instance.file_file_name, '.*')}.mp4"
         attachment.instance.file_content_type = 'video/mp4'
         attachment.instance.type              = MediaAttachment.types[:gifv]
       end