Browse Source

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

tags/2021-05-28
jules 11 years ago
parent
commit
3100e54728
1 changed files with 13 additions and 0 deletions
  1. +13
    -0
      extras/Introjucer/Source/Project Saving/jucer_ProjectExport_XCode.h

+ 13
- 0
extras/Introjucer/Source/Project Saving/jucer_ProjectExport_XCode.h 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;


Loading…
Cancel
Save