+def getimgname(file):
+ """
+ {
+ 'Image00001': [{
+ 'color': '#ff0000',
+ 'points': [
+ {'x': 94.377, 'y': 137.39},
+ {'x': 100.38, 'y': 139.55},
+ {'x': 103.26, 'y': 142.67},
+ {'x': 105.91, 'y': 147.95},
+ {'x': 105.42, 'y': 152.76},
+ {'x': 100.62, 'y': 156.84},
+ {'x': 95.338, 'y': 159.96},
+ {'x': 89.573, 'y': 158.52},
+ {'x': 84.53, 'y': 153},
+ {'x': 82.848, 'y': 149.15},
+ {'x': 82.368, 'y': 142.91},
+ {'x': 85.01, 'y': 138.11},
+ {'x': 89.813, 'y': 137.39},
+ {'x': 94.377, 'y': 137.39}
+ ]
+ }]
+ }
+ return 'Image00001' or return ''
+ """
+ imgXXX = None
+ # print("file", file)
+ with open(file) as jsonfile:
+ data = json.load(jsonfile)
+ if len(data) > 1:
+ print("more than one image in same json")
+ # print("data")
+ # pprint(data)
+ for imgXXX in data: pass # get the value of key ~= "Image00001", cause it's dynamic
+ return imgXXX
+
+