code: def do_size(self, w, h):
          
          # simeon@ice ~>cat m1.pnm | pnmscale -width 50 > m2.pnm
          infile = self.tmpfile
          outfile = self.basename + '.siz'
          if (w is None):
              # print "size: no scaling"
              self.tmpfile = infile
          else:
              # print "size: scaling to (%d,%d)" % (w,h)
              if (self.shell_call('cat ' + infile + ' | ' + self.pnmscale + ' -width ' + str(w) + ' -height ' + str(h) + '  > ' + outfile)):
                  raise IIIFError(
                      text="Oops... got nonzero output from pnmscale.")
              self.width = w
              self.height = h
              self.tmpfile = outfile
docs: Apply size scaling.