119-magic-update-xwd.patch 1.3 KB

1234567891011121314151617181920212223242526272829303132333435
  1. Author: Adam Buchbinder <adam.buchbinder@gmail.com>
  2. Description:
  3. The XWD magic is too simple--it just matches a single big-endian long at the
  4. beginning of the file. This patch implements a few other checks
  5. (Closes: #511764).
  6. diff -Naurp file.orig/magic/Magdir/images file/magic/Magdir/images
  7. --- file.orig/magic/Magdir/images 2009-03-21 09:20:04.000000000 +0000
  8. +++ file/magic/Magdir/images 2009-03-21 09:34:29.000000000 +0000
  9. @@ -308,11 +308,20 @@
  10. # As described in /usr/X11R6/include/X11/XWDFile.h
  11. # used by the xwd program.
  12. # Bradford Castalia, idaeim, 1/01
  13. -4 belong 7 XWD X Window Dump image data
  14. ->100 string >\0 \b, "%s"
  15. ->16 belong x \b, %dx
  16. ->20 belong x \b%dx
  17. ->12 belong x \b%d
  18. +# updated by Adam Buchbinder, 2/09
  19. +# The following assumes version 7 of the format; the first long is the length
  20. +# of the header, which is at least 25 4-byte longs, and the one at offset 8
  21. +# is a constant which is always either 1 or 2. Offset 12 is the pixmap depth,
  22. +# which is a maximum of 32.
  23. +0 belong >100
  24. +>8 belong <3
  25. +>>12 belong <33
  26. +>>>4 belong 7 XWD X Window Dump image data
  27. +!:mime image/x-xwindowdump
  28. +>>>>100 string >\0 \b, "%s"
  29. +>>>>16 belong x \b, %dx
  30. +>>>>20 belong x \b%dx
  31. +>>>>12 belong x \b%d
  32. # PDS - Planetary Data System
  33. # These files use Parameter Value Language in the header section.