# Reason for image not loading?

**URL:** <https://forum.juce.com/t/reason-for-image-not-loading/41356>\
**Category:** General JUCE discussion\
**Created:** [August 21, 2020, 6:05pm UTC](https://forum.juce.com/t/reason-for-image-not-loading/41356 "2020-08-21T18:05:11Z")\
**Posts on this page:** 5\
**Page:** 1

<div class="post-metadata">

**Author:** ![HowardAntares](https://sea2.discourse-cdn.com/flex026/user_avatar/forum.juce.com/howardantares/32/4629_2.png) [@HowardAntares](https://forum.juce.com/u/HowardAntares)\
**Post date:** [August 21, 2020, 6:05pm UTC](https://forum.juce.com/t/reason-for-image-not-loading/41356/1 "2020-08-21T18:05:11Z")

</div>

I’m trying to figure out why a plugin (AAX) is crashing in Pro Tools when the UI is shown. We’re using the same graphics in this project as we use in other plugins, but it’s hitting an assertion when debugging:

```
            auto cgImage = dynamic_cast<CoreGraphicsImage*> (image.getPixelData());
            jassert (cgImage != nullptr); // if USE_COREGRAPHICS_RENDERING is set, the CoreGraphicsImage class should have been used.

```

Not sure what I’m doing wrong here, or different from our other projects. (Running in Xcode 10 under OS 10.15.)

---

<div class="post-metadata">

**Author:** ![otristan](https://avatars.discourse-cdn.com/v4/letter/o/f0a364/32.png) [@otristan](https://forum.juce.com/u/otristan)\
**Post date:** [August 21, 2020, 6:08pm UTC](https://forum.juce.com/t/reason-for-image-not-loading/41356/2 "2020-08-21T18:08:50Z")

</div>

> [@AAX Crash on Catalina](https://forum.juce.com/t/aax-crash-on-catalina/36951):
>
> Hi, An AAX plugin with Image from BinaryData crashes when opened with ProTools on Catalina It is very easy to reproduce take AudioPluginDemo add an image in projucer (in my case icon.png) load it with getFromMemory backgroundImage = ImageCache::getFromMemory (BinaryData::icon\_png, BinaryData::icon\_pngSize); ProTools crashes Thread 0 Crashed:: Main Thread Dispatch queue: com.apple.main-thread 0 com.JUCE.AudioPluginDemo 0x000000012f60fe27 juce::juce\_loadWithCoreImage(juc…

?

---

<div class="post-metadata">

**Author:** ![HowardAntares](https://sea2.discourse-cdn.com/flex026/user_avatar/forum.juce.com/howardantares/32/4629_2.png) [@HowardAntares](https://forum.juce.com/u/HowardAntares)\
**Post date:** [August 21, 2020, 6:17pm UTC](https://forum.juce.com/t/reason-for-image-not-loading/41356/3 "2020-08-21T18:17:38Z")

</div>

That indeed looks to be the problem. No idea how to resolve it, though. Gonna see if simply running my debug build in an earlier OS works or not. If so, I can at least move on with what I was working on originally.

---

<div class="post-metadata">

**Author:** ![otristan](https://avatars.discourse-cdn.com/v4/letter/o/f0a364/32.png) [@otristan](https://forum.juce.com/u/otristan)\
**Post date:** [August 21, 2020, 6:59pm UTC](https://forum.juce.com/t/reason-for-image-not-loading/41356/4 "2020-08-21T18:59:55Z")

</div>

Renaming CoreGraphicsImage class to MyCoreGraphicsImage does the trick

If you use cmake you can try as well  
set\_target\_properties({targetname} PROPERTIES CXX\_VISIBILITY\_PRESET hidden) set\_target\_properties({targetname} PROPERTIES VISIBILITY\_INLINES\_HIDDEN 1)

or their regular flags equivalent

---

<div class="post-metadata">

**Author:** ![HowardAntares](https://sea2.discourse-cdn.com/flex026/user_avatar/forum.juce.com/howardantares/32/4629_2.png) [@HowardAntares](https://forum.juce.com/u/HowardAntares)\
**Post date:** [August 24, 2020, 2:35pm UTC](https://forum.juce.com/t/reason-for-image-not-loading/41356/5 "2020-08-24T14:35:14Z")

</div>

Works fine in 10.14. Using that for now. Hopefully a Pro Tools update resolves it. Will check that when I get a chance.
