File: read-pam

package info (click to toggle)
pypng 0.20220715.0-1
  • links: PTS, VCS
  • area: main
  • in suites: bookworm
  • size: 704 kB
  • sloc: python: 4,816; sh: 204; makefile: 18
file content (20 lines) | stat: -rwxr-xr-x 464 bytes parent folder | download | duplicates (2)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
#!/bin/sh

# Test that pripamtopng can read a true PAM file.
# It is not a very comprehensive test, it merely
# tests that pripamtopng generates the correct
# IHDR chunk.

PATH=${PWD%code*}code:$PATH

apamfile () {
  printf 'P7\n'
  printf 'WIDTH 3\nHEIGHT 1\nDEPTH 4\nMAXVAL 255\nTUPLTYPE RGB_ALPHA\n'
  printf 'ENDHDR\n'
  printf '\377\0\0\377\0\377\0\170\0\0\377\36'
}

apamfile |
  pripamtopng - |
  pripnglsch - |
  grep -q 'IHDR.*00000003000000010806000000'