public function setICC(PelJpegContent $icc)
    {
        $app1_offset = 1;
        $app2_offset = - 1;

        /* Search through all sections looking for APP0 or APP1. */
        $count_sections = count($this->sections);
        for ($i = 0; $i < $count_sections; $i ++) {
            if (! empty($this->sections[$i][0])) {
                if ($this->sections[$i][0] == PelJpegMarker::APP1) {
                    $app1_offset = $i;
                } elseif ($this->sections[$i][0] == PelJpegMarker::APP2) {
                    $app2_offset = $i;
                    break;
                }
            }
        }

        /*
         * Store the Exif data at the appropriate place, either where the
         * old Exif data was stored ($app1_offset) or right after APP0
         * ($app0_offset+1).
         */
        if ($app2_offset > 0) {
            $this->sections[$app1_offset][1] = $icc;
        } else {
            $this->insertSection(PelJpegMarker::APP2, $icc, $app1_offset + 1);
        }
    }