#23 Use valid images for the test PNG and GIF data
Merged 4 years ago by jhutar. Opened 4 years ago by dshea.
dshea/rpmfluff image-data  into  master

file modified
+6 -2
@@ -227,10 +227,14 @@ 

          dstFile.write(self.values)

  

  def make_png():

-     return [BytesAt(0, b"\x89PNG\x0d\x0a\x1a\x0a")]

+     return [BytesAt(0, b"\x89\x50\x4e\x47\x0d\x0a\x1a\x0a\x00\x00\x00\x0d\x49\x48\x44\x52"

+                        b"\x00\x00\x00\x01\x00\x00\x00\x01\x08\x06\x00\x00\x00\x1f\x15\xc4"

+                        b"\x89\x00\x00\x00\x0a\x49\x44\x41\x54\x78\x9c\x63\x00\x01\x00\x00"

+                        b"\x05\x00\x01\x0d\x0a\x2d\xb4\x00\x00\x00\x00\x49\x45\x4e\x44\xae"

+                        b"\x42\x60\x82")]

  

  def make_gif():

-     return [BytesAt(0, b"GIF8")]

+     return [BytesAt(0, b"GIF89a\x01\x00\x01\x00\x00\x00\x00\x3b")]

  

  def make_elf(bit_format=64):

      """

Replace the data in make_png() and make_gif() with small but valid
images from https://github.com/mathiasbynens/small

In the case of PNG in particular, the file command now returns "data"
for a PNG header with no IHDR chunk. The new test data allows make_png
to output files that are still recognizable as PNG.

rebased onto 0571a8b

4 years ago

Pull-Request has been merged by jhutar

4 years ago
Metadata