0

Is the image ID returned by sp_album_cover and sp_artist_portrait zero terminated? or is its length fixed?

Thanks.

mile
  • 402
  • 1
  • 6
  • 15

1 Answers1

1

It's an opaque struct: i.e., its contents are undefined.

If you want a sane way of printing or storing an image, convert it to a link then a string: sp_link_create_from_image() followed by sp_link_as_string().

iKenndac
  • 18,730
  • 3
  • 35
  • 51
  • **sp_image_create** takes 20 bytes long image_id parameter. Does that mean the maximum length of image id is 20 bytes? – mile Jun 04 '12 at 15:33
  • No. `sp_subscribers` is another example of where we've put a fake number in for the compiler. – iKenndac Jun 04 '12 at 15:40
  • What I'm trying to say is: The contents of an image id pointer are opaque and likely to change between releases. Don't write code that makes assumptions about them, because it'll break. – iKenndac Jun 04 '12 at 15:41