Import image with thumbnails issue

Hi,

I have an issue when I import a document with image and thumbnails.

In my document, we can see this :

I want to import my document with some changes, except on this slice.
Here is a part of my import file with image.

We can see that for the thumb_mobile_view, the image is different than the other images (as expected).

After import, we can see in the preview :

The image is not the one we imported.

It seems that the import replace all the thumbnails with the main image, but keep the size/ratio.

Can you check if I made something wrong or if there is an issue in the import process ?

Thanks !

Hello @Xavier

Welcome to the Prismic community.

I found an issue in your import file screenshot. You need to update origin.id, origin.url, origin.width and origin.height in the thumb_mobile_view. All values for these keys should be the same as in the main image title_rectangle_image.

Give this a try and let me know if you have any questions related to it.

Thanks,
Priyanka

Hello @Priyanka

Thanks for your response.

The problem is that I don't want the thumb_mobile_view to be identical to the main image.

I need different images between the main and the mobile view.

Hello @Xavier

I am looking into it and will come back to you.

Thanks,
Priyanka

Hello @Xavier

It's possible to upload different images with multiple views. Just keep the origin.url data for the thumbnail and nothing else. Give this a try and let me know if you still find any issues.

Thanks,
Priyanka

Hello @Priyanka

I tried but I have the same problem.

There is no solution to import a document without editing it ?
The problem is that if we have a lot of files with different thumbnails, we will have to spend a lot of time editing all the import files to remove all the data.

Hello @Xavier

Sorry for being delayed response.

I am checking with the team if there is any possibility to achieve this.

Thanks,
Priyanka

Hi Xavier,

The import module has some limitations, one of them is that it automatically regenerates thumbnails based on the origin data for the main image specified in the import JSON file. Thus, image data you provide in Import JSON files for responsive views of a given image field are ignored in the importing job.

If you're looking to make a major update to a lot of documents without affecting custom images already uploaded in existing responsive views, the only option I see is to deport this custom views data into specific image fields (so in your case adding 2 dedicated image fields for thumb_tablet_view and thumb_mobile_view) and adapt the queries in your code accordingly.

Note that this will also change the way content editors will see these 3 images: they'll see 3 image fields in the editor instead of one image component with multiple bullets allowing to edit the views.

I hope this clarifies the option and sorry for the inconvenience it might cause in your case.

Nathan

Hello @Xavier,

I hope the above response gives you an answer. Let me know if you have any further questions.

Thanks,
Priyanka