Copy link to clipboard
Copied
After finishing Write sequence in format plug-in I need to force host to read the file again or read file and then invalidate the image in the window.
saved image can be different from the source. how can I do it?
I really appreciate any advices.
Cheers.
Same for GIF and others (you do get the preview option though). I believe this is the general modus operandi of Photoshop - as far as they key features of the file, such as layers, channels, color mode etc can be maintained by the destination format, you can 'Save As' the file however your in-memory document will not be a true represenation of your file on the disk until explicitly closed and re-open. I'm not sure that breaking this paradigm just for your specific format would worth the effo
...Copy link to clipboard
Copied
I'm personally unaware about any build-in functions that would allow you to do exactly what you want. Of course you could come up with a fancy export-automation-import combo that upon save would send a notification to your automation that would, say, prompt the user, and then close the current document and re-open the saved one, however its probably not what you'd like to do. I'm actually wondering whether the approach you are trying to implement is the best way to deal with the problem. In case the saved file is so different from the current one that it must be re-read to properly reflect the changes, may be its better to have 'Save as' option disabled altogether and force 'Save as copy' instead. This approach is usually used when certain features or properties of the current document cannot be maintained in the destination format (e.g. try saving either a multi-layer TIFF or an Index color document into BMP format that doesn't support either of these - 'Save: as a copy' on the Save dialog will be checked and disabled), so if your case is similar to it, this would probably be the way to go.
Copy link to clipboard
Copied
Output is different as with jpeg files with different quality values.
For example, I loaded jpeg file and "save as" it with minimum "0" quality, so output is different too, but photoshop still showing me the old image. This is weird?
Copy link to clipboard
Copied
Same for GIF and others (you do get the preview option though). I believe this is the general modus operandi of Photoshop - as far as they key features of the file, such as layers, channels, color mode etc can be maintained by the destination format, you can 'Save As' the file however your in-memory document will not be a true represenation of your file on the disk until explicitly closed and re-open. I'm not sure that breaking this paradigm just for your specific format would worth the effort.
Copy link to clipboard
Copied
Thank you. I think you are right.
BTW
in struct FormatRecord
int32 maxValue; /**< Used for read with 16-bit depth only. */
Copy link to clipboard
Copied
Ooo I see, 32-bit format is not int32 as I thought but real32 (float) 🙂
Copy link to clipboard
Copied
For example, I loaded jpeg file and "save as" it with minimum "0" quality, so output is different too, but photoshop still showing me the old image. This is weird?
No, because you are editing a document (or the file you opened), not the file you just saved.
Your document remains as-is, and you can save it to multiple filenames and file types with different settings.
Only if you close the document and open one of those specific files should you see the lossy version of the image in that particular file.
Losing quality in the document with every save -- that would create more than a few angry customers.
Copy link to clipboard
Copied
Caption after "Save As" shows just "saved as" new file name. Which tells me what I have a new file opened. And I became an angry customer.