So I have an InputStream which contains some data as well as some PNG data – if we read the stream and use
Image image (PNGImageFormat().decodeImage (stream)); int myIntValue = stream.readInt();
with JUCE_USING_COREIMAGE_LOADER defined then juce_loadWithCoreImage reads in the entire stream:
MemoryBlock data; input.readIntoMemoryBlock (data, -1);
but never resets the stream position so then the next read (myIntValue) fails because it’s at the end of the stream.
With JUCE_USING_COREIMAGE_LOADER undefined then PNGHelpers::readImage() works fine and keeps the stream position correct for the next read.