def width= w
      @head_data.pos = 8
      while bytes = @head_data.read(8)
        length, type = bytes.unpack 'Na*'
        if type == 'IHDR'
          @head_data << [w].pack('N')
          @head_data.pos -= 4
          data = @head_data.read length
          @head_data << [Zlib.crc32(data, Zlib.crc32(type))].pack('N')
          break
        end
      end
      @head_data.rewind
      w
    end
def width= w
      @head_data.pos = 8
      while bytes = @head_data.read(8)
        length, type = bytes.unpack 'Na*'
        if type == 'IHDR'
          @head_data << [w].pack('N')
          @head_data.pos -= 4
          data = @head_data.read length
          @head_data << [Zlib.crc32(data, Zlib.crc32(type))].pack('N')
          break
        end
      end
      @head_data.rewind
      w
    end
Rewrites the width value.