As PHP GD library doesn't copy the ICC color profiles, I do wish to insert a function after thumbnail files are generated to post-process them and copy the ICC profile from the source image.
I think that inserting the thumbnail post-process hooks needs to be done in /lib/media.php, once for sys- files and once for th- files. That is function sys_thumb() and function upload_image().
The idea is to insert this post-processing after line:
$this->do_output($output_image, $this->image);
and before line:
imagedestroy($output_image);.
I do need the <strong>source image location</strong>, that is path and filename. My idea is to use $this->input_image for that. And I need the generated <strong>resized thumbnail location</strong>, for which I use $this->image.
After making these changes, image uploading fails silently.
Questions:
1. How to detect jpeg images? if ($this->filemime == 'jpg')?
2. Are the suggested hook insertion locations ok?
3. Are the suggested source and destination file locations ok?
4. How to turn on debugging output (all error messages)?