1
0
Fork 0
mirror of https://github.com/juce-framework/JUCE.git synced 2026-01-10 23:44:24 +00:00

Introjucer: workaround for building OSX icons if only a 1024x1024 image is supplied

This commit is contained in:
jules 2014-01-08 15:25:18 +00:00
parent e68a654646
commit 3100e54728

View file

@ -458,12 +458,20 @@ private:
void writeIcnsFile (const OwnedArray<Drawable>& images, OutputStream& out) const
{
MemoryOutputStream data;
int smallest = 0x7fffffff;
Drawable* smallestImage = nullptr;
for (int i = 0; i < images.size(); ++i)
{
const Image image (fixMacIconImageSize (*images.getUnchecked(i)));
jassert (image.getWidth() == image.getHeight());
if (image.getWidth() < smallest)
{
smallest = image.getWidth();
smallestImage = images.getUnchecked(i);
}
switch (image.getWidth())
{
case 16: writeOldIconFormat (data, image, "is32", "s8mk"); break;
@ -479,6 +487,11 @@ private:
jassert (data.getDataSize() > 0); // no suitable sized images?
// If you only supply a 1024 image, the file doesn't work on 10.8, so we need
// to force a smaller one in there too..
if (smallest > 512 && smallestImage != nullptr)
writeNewIconFormat (data, rescaleImageForIcon (*smallestImage, 512), "ic09");
out.write ("icns", 4);
out.writeIntBigEndian ((int) data.getDataSize() + 8);
out << data;