Thomas Jensen

part_img_url points to wrong colored image

Recommended Posts

When querying the parts of a set, the returned part_img_url points to the wrong image

example, the red train front base is white, but the returned image is blue.

https://rebrickable.com/api/v3/lego/sets/7938-1/parts/

id 363383
inv_part_id 363383
part  
part_num "87619"
name "Train Front Sloping Base with 4 Studs"
part_cat_id 5
part_url "https://rebrickable.com/parts/87619/train-front-sloping-base-with-4-studs/"
part_img_url "https://m.rebrickable.com/media/parts/elements/4612111.jpg"
external_ids  
BrickOwl  
0 "788601"
color  
id 15
name "White"
rgb "FFFFFF"
is_trans false
 

Share this post


Link to post
Share on other sites

I think I have found a fix/workaround for this issue,  looks like the call for:/api/v3/lego/parts/{part_num}/colors/ is still getting the correct URLs.

{
  "count": 4,
  "next": null,
  "previous": null,
  "results": [
    {
      "color_id": 1,
      "color_name": "Blue",
      "num_sets": 1,
      "num_set_parts": 1,
      "part_img_url": "https://m.rebrickable.com/media/parts/elements/4612111.jpg",
      "elements": [
        "4612111"
      ]
    },
    {
      "color_id": 5,
      "color_name": "Dark Pink",
      "num_sets": 1,
      "num_set_parts": 1,
      "part_img_url": "https://m.rebrickable.com/media/parts/elements/6056386.jpg",
      "elements": [
        "6056386"
      ]
    },
    {
      "color_id": 15,
      "color_name": "White",
      "num_sets": 3,
      "num_set_parts": 4,
      "part_img_url": "https://m.rebrickable.com/media/parts/elements/4560938.jpg",
      "elements": [
        "4560938"
      ]
    },
    {
      "color_id": 72,
      "color_name": "Dark Bluish Gray",
      "num_sets": 4,
      "num_set_parts": 6,
      "part_img_url": "https://m.rebrickable.com/media/parts/elements/4581526.jpg",
      "elements": [
        "4581526"
      ]
    }
  ]
}

looks like the part image URL does have the correct info,  also it seems for the parts, it is using the 1st one it comes across in: /api/v3/lego/sets/{set_num}/partsat least for the part_image_url and is not properly linked in the query.

Share this post


Link to post
Share on other sites

I too have this problem, but using the elementid doesnt work for all parts as some dont have an elementid, so for those I fall back to the provided image. Ive also run into some items with elementids that still dont have an image.

Good to know about the color api call, might look at using that when all else fails.

Share this post


Link to post
Share on other sites
11 hours ago, Thomas Jensen said:

the admin should know about it as this sub forum is about the API including bugs, but strangely there have been no comments so far :-)

@Nathan  < Using the "Get Nathan's attention".  Because I don't use the API, I can't really help or comment.

Share this post


Link to post
Share on other sites
5 hours ago, feanferr said:

Still nothing? @Nathan

Nathan did some work on image problems, but it may take 3 days to work.  This is because the image download access is on a cycle.

Share this post


Link to post
Share on other sites

The recent change was unrelated to this. The problem here is to do with the framework I'm using. I haven't found a solution yet. 

Share this post


Link to post
Share on other sites
On 3/23/2018 at 5:37 AM, Thomas Jensen said:

the admin should know about it as this sub forum is about the API including bugs, but strangely there have been no comments so far :-)

Sorry i have a bad habit of only commenting once i have a solution! 

Share this post


Link to post
Share on other sites
7 hours ago, Nathan said:

Sorry i have a bad habit of only commenting once i have a solution! 

No problem :-)

The workarounds we have identified so far should cover the situation, although it would mean some extra api calls.

Share this post


Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now