diff --git a/lib/origami/graphics/xobject.rb b/lib/origami/graphics/xobject.rb
index <HASH>..<HASH> 100644
--- a/lib/origami/graphics/xobject.rb
+++ b/lib/origami/graphics/xobject.rb
@@ -666,15 +666,15 @@ module Origami
 
                 raise ArgumentError, "Missing file format" if format.nil?
                 case format.downcase
-                when 'jpg', 'jpeg', 'jpe', 'jif', 'jfif', 'jfi'
+                when '.jpg', 'jpeg', '.jpe', '.jif', '.jfif', '.jfi'
                     image.setFilter :DCTDecode
                     image.encoded_data = data
 
-                when 'jp2','jpx','j2k','jpf','jpm','mj2'
+                when '.jp2','.jpx','.j2k','.jpf','.jpm','.mj2'
                     image.setFilter :JPXDecode
                     image.encoded_data = data
 
-                when 'jb2', 'jbig', 'jbig2'
+                when '.jb2', '.jbig', '.jbig2'
                     image.setFilter :JBIG2Decode
                     image.encoded_data = data
                 else
graphics/xobject: fix extensions in from_image_file