BUG : Could not fetch image from

Hi

We have a bug since a while (we din’t change anything)

The console says : Could not fetch image from https://sdr7euc1-nocdn.eu-central-1.shapediver.com/api/v2/session/XXX/export/YYYYYYY

From SD file A, we are exporting a PNG image

From SD file B, we use the URL as an ‘Opacity Map’ in the Legacy Material component

It was working well, and I just realised it’s not working anymore.

I reproduced the bug in a SD demo file, but please consider that the URL not working is temporary.
But when I tested the URL, I dit get an image.

Are you aware of any changes?

Bug URL Image could not be fetch.gh (16.1 KB)

Thanks
Olivia

Our team is looking into the issue and will get back to you early next week.

Could you explain how your application is implemented? Are you using the viewer API to export an image from model A and then using this URL as an input for model B using the API again?

In any case, the URL created by model A is a temporary one. If model A is not recomputed, after a while model B will stop showing it because the temporary URL will stop to function.

If you want to implement such a workflow, you will need to fetch the texture image from model A and store it somewhere, then use the URL of this location to input it in model B.

There might be a simpler way to structure your application, I can maybe suggest something if you give me some details about your setup.

Hello Mathieu

(sorry for the delay, I was in holidays :slight_smile: )

Our workflow works since few years in production
Yes, we use the viewer API to export an image from model A and then using this URL as an input for model B using the API again

We know this url is temporary but that’s enough in our case.
This was working until few weeks.

We really need to find a solution, as this bug is in production and break all our shop process.

Thanks for your help

We would need access to the app to be able to reproduce and investigate the problem. Is it possible to get a link and a list of steps to reproduce?

Something that could help is to look at the “Network” tab of the console and get the exact error thrown by the API when trying to fetch the image (the console log is not specific). If you cannot give me a working link, this could already provide some helpful information.

Please go to Configurateur Garde-corps - Primo Gardex
Step 2, clic on “Changer de motif” and choose a pattern
In the console you’ll see : Error: Could not fetch image from…

Just a few more details: could you describe what the workflow is when choosing a new pattern?
At first, one sees a 3d model in the viewer. Do I understand correctly that, when clicking on the “Changer de motif” button, the following steps happen:

  1. An export is triggered from the model and the temporary url is retrieved in the application.
  2. The session to the first model is closed
  3. A session to the second model is opened and a text input of the second model is filled with the temporary url. The second model should then be displayed in the App instead of the first one.

we don’t close or open session..
When the user clic, it calls App A to generate the image, and get the URL

The URL is saved in the form (in fact we generate 3 images and get 3 URL)

fields : param_texture_url_cote, param_texture_url_angle, param_texture_url_angle

Then we use this URL in the input parameter ‘material_pattern_alpha’ of the Primo Gardex shapediver App

If you clic on the URL generated, you’ll see the image is working

Maybe this can help
I have another similar issue with different process (this is is Development stage)

I have a crop function in PHP to crop an image with dynamic width and height
The URL is working : https://urbafence.amphi.beer/wp-admin/admin-ajax.php?action=crop&img=demo.png&w=800&h=1750

but generates an error in shapediver Console
Invalid response when trying to fetching texture from https://urbafence.amphi.beer/wp-admin/admin-ajax.php?action=crop&img=demo.png&w=800&h=1750

This is the same issue, as I would like to use an URL of an image without having to save the file on a server

I created a minimal model using the last image you linked, and could successfully import it using the Import Bitmap component:

https://www.shapediver.com/app/m/imagetest-6

Maybe I am misunderstanding the issue, but without understanding exactly what your application is doing it is difficult for me to reproduce or understand the cause of the error. Would it be possible for you to include a minimal piece of code of what your application is doing when importing this last image into the application?

As a side note, I noticed the application is using a very old version of the viewer 3 (2.2.2). I would recommend upgrading the application to the latest version (3.15.12).

I found an explaination for the second case, thanks to your example

I need to use the “Import Bitmap” component with my crop URL, but it’s time consuming…

However, this not solved the first case, let me try to summarised the problem in a coming up message

It does also work using the url directly in the texture input:

Are you using the latest version of the ShapeDiver plugin?

I have V 1.31.1 in Rhino 7

I tested with this version in Rhino 7 and it also works as expected for me. Could you please share a screenshot of the error you see? Which component throws an error, the material component or the display component?

Here is a demo with and without the ‘Import bitmap’ component’

We are almost there, if you could give me the link to this model, our team would be able to start investigating. If possible in a very minimal version only using the url, and the material and display components.

GlTf viewer crop URL in texture.gh (19.4 KB)

here is an example file where you can reproduce the issue

We did it :slight_smile: . Our team can reproduce the issue and will work on a fix. I will let you know once it’s resolved.

thanks !

The problem should be resolved. Please test and let us know.