Skip to content

adding new chunk will make $_contents and $_chunks out of sync #3

@jozefbriss

Description

@jozefbriss

Adding the following or similar on line 75 of Image.php could fix the problem:

    $data_size = strlen($data);
    $chunk = array(
      'size' => $data_size + self::CHUNK_OVERHEAD_BYTES,
      'type' => $type,
      'data_size' => $data_size,
      'data' => $data,
      'raw_data' => $data,
      'crc' => crc32($type . $data),
    );
    $c = count($this->_chunks);
    $this->_chunks[$c] = $this->_chunks[$c - 1];
    $this->_chunks[$c - 1] = $chunk;

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type
    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions