# JUCE 8 / Direct2D—assertion when calling getFromMemory()

**URL:** <https://forum.juce.com/t/juce-8-direct2d-assertion-when-calling-getfrommemory/61857>\
**Category:** Direct2D\
**Created:** [June 14, 2024, 8:09pm UTC](https://forum.juce.com/t/juce-8-direct2d-assertion-when-calling-getfrommemory/61857 "2024-06-14T20:09:13Z")\
**Posts on this page:** 8\
**Page:** 1

<div class="post-metadata">

**Author:** ![davidleonalex](https://avatars.discourse-cdn.com/v4/letter/d/58f4c7/32.png) [@davidleonalex](https://forum.juce.com/u/davidleonalex)\
**Post date:** [June 14, 2024, 8:09pm UTC](https://forum.juce.com/t/juce-8-direct2d-assertion-when-calling-getfrommemory/61857/1 "2024-06-14T20:09:13Z")

</div>

I’m getting an assertion when calling juce::ImageCache::getFromMemory() with a large filmstrip file.

The filmstrip file is pretty big, 19200 pixels high and I’m getting the following assertion

```
   #if JUCE_DEBUG
    // Verify that the GPU can handle a bitmap of this size
    //
    // If you need a bitmap larger than this, you'll need to either split it up into multiple bitmaps
    // or use a software image (see SoftwareImageType).
    auto maxBitmapSize = deviceContext->GetMaximumBitmapSize();
    jassert (size.width <= maxBitmapSize && size.height <= maxBitmapSize);
   #endif

```

The trace is here →

 ![Screenshot 2024-06-14 at 20.35.30](https://us1.discourse-cdn.com/flex026/uploads/juce/original/3X/a/9/a944aebd4856401c0edc4ee39a837165c13e719c.jpeg)

I am using SoftwareImageType() for my image, but the assertion is triggered by the Juce getFromMemory() function, so possibly this is a bug?

---

<div class="post-metadata">

**Author:** ![oli1](https://sea2.discourse-cdn.com/flex026/user_avatar/forum.juce.com/oli1/32/15664_2.png) [@oli1](https://forum.juce.com/u/oli1)\
**Post date:** [June 19, 2024, 9:37am UTC](https://forum.juce.com/t/juce-8-direct2d-assertion-when-calling-getfrommemory/61857/2 "2024-06-19T09:37:19Z")

</div>

This is a known issue and I’m looking into it!

---

<div class="post-metadata">

**Author:** ![remaincalm](https://sea2.discourse-cdn.com/flex026/user_avatar/forum.juce.com/remaincalm/32/18211_2.png) [@remaincalm](https://forum.juce.com/u/remaincalm)\
**Post date:** [June 20, 2024, 9:43am UTC](https://forum.juce.com/t/juce-8-direct2d-assertion-when-calling-getfrommemory/61857/3 "2024-06-20T09:43:32Z")

</div>

I’ve run into a sortof-unrelated issue in [Loading bulk PNGs in threads got unsafe when moved to Direct2D?](https://forum.juce.com/t/loading-bulk-pngs-in-threads-got-unsafe-when-moved-to-direct2d/61924) , but I wanted to call out that:

`juce::PNGHelpers::createImageFromData`  
(in your stack trace there)

creates an image with this, which will always use NativeImageType, which will hit the d2d accelerated bitmap size limit:

`Image image(hasAlphaChan ? Image::ARGB : Image::RGB, width, height, hasAlphaChan);`

I’m looking for a neat way to override this myself (see linked thread above for why)

Cheers

---

<div class="post-metadata">

**Author:** ![wkundrus](https://avatars.discourse-cdn.com/v4/letter/w/34f0e0/32.png) [@wkundrus](https://forum.juce.com/u/wkundrus)\
**Post date:** [July 14, 2024, 10:59am UTC](https://forum.juce.com/t/juce-8-direct2d-assertion-when-calling-getfrommemory/61857/4 "2024-07-14T10:59:07Z")

</div>

We run into the same issue. We have lots of bitmaps organized as filmstrips and their are all too large. I tried to find out, how I could fall back to using the software renderer, but that does not fix this issue, as the bitmap loading isn’t related to the window renderer. Is there a switch to avoid Direct2D entirely ?

---

<div class="post-metadata">

**Author:** ![alexrodi](https://avatars.discourse-cdn.com/v4/letter/a/4491bb/32.png) [@alexrodi](https://forum.juce.com/u/alexrodi)\
**Post date:** [August 22, 2024, 2:09pm UTC](https://forum.juce.com/t/juce-8-direct2d-assertion-when-calling-getfrommemory/61857/5 "2024-08-22T14:09:45Z")

</div>

Bump! same here

---

<div class="post-metadata">

**Author:** ![Stevezee](https://avatars.discourse-cdn.com/v4/letter/s/5f9b8f/32.png) [@Stevezee](https://forum.juce.com/u/Stevezee)\
**Post date:** [August 31, 2024, 11:58pm UTC](https://forum.juce.com/t/juce-8-direct2d-assertion-when-calling-getfrommemory/61857/6 "2024-08-31T23:58:06Z")

</div>

I’m having the same issue! Filmstrips are not compatible at this time with JUCE 8?

---

<div class="post-metadata">

**Author:** ![matt](https://sea2.discourse-cdn.com/flex026/user_avatar/forum.juce.com/matt/32/18340_2.png) [@matt](https://forum.juce.com/u/matt)\
**Post date:** [September 3, 2024, 4:28pm UTC](https://forum.juce.com/t/juce-8-direct2d-assertion-when-calling-getfrommemory/61857/7 "2024-09-03T16:28:07Z")

</div>

Each GPU has a maximum texture size that in turn limits the size of a Direct2D bitmap. I believe the JUCE team is working on an update that supports using multiple Direct2D bitmaps for a single JUCE Image.

Matt

---

<div class="post-metadata">

**Author:** ![reuk](https://sea2.discourse-cdn.com/flex026/user_avatar/forum.juce.com/reuk/32/21494_2.png) [@reuk](https://forum.juce.com/u/reuk)\
**Post date:** [September 18, 2024, 4:46pm UTC](https://forum.juce.com/t/juce-8-direct2d-assertion-when-calling-getfrommemory/61857/8 "2024-09-18T16:46:58Z")

</div>

Thanks for your patience. We’ve just merged support for very large bitmaps in the Direct2D renderer to the develop branch:

> <https://github.com/juce-framework/JUCE/commit/589d9940ede39fc98c51f7b97920fdde8259a7a2>
