0

I am just getting into python and am specifically using Pillow and piexif to extract and edit EXIF data for bunch of jpegs that I have. I used piexif to extract and read the EXIF data information like ImageDescription, and noticed lots of fields have random letters in front; when I first pulled ImageDescription, it read b'Olympus.....' I edited the tag and when I output it now gave me, as a test, just test (no b or apostrophe's, and samples from piexif showed u's)

Anyone know the purpose of the apostrophe and/or the random letters?

2 Answers2

0

I did some research and found that there are several letters that are used like u, r or b. If an r is found before the string, it becomes a string literal, and u and b are just encoding options.

0

These are not "random letters". They signify Unicode literals (u prefix), raw literals (r) and bytestrings (b).

gspr
  • 11,144
  • 3
  • 41
  • 74