Xcode adding strange locale to images in xcassets

When I drag png files into xcassets, they display correctly in Xcode but can no longer be loaded by UIImage(named:). This appears to be caused by a new line in the Contents.json file describing "locale."

Code Block
{
"filename" : "sidebar-album.png",
"idiom" : "universal",
"locale" : "Programming",
"scale" : "1x"
},

Removing that line allows loading the images to load. This is the first time I've added images since upgrading to Xcode 12, so I assume this is related.

The "Programming" locale seems to be coming from the name of the root folder. The source of the images is a folder in ~/[ Programming ]/folder1/folder2/folder3/images. If I move the source to another folder it takes the name of that folder instead.

Is there a way to shut this off?
I tried the same with a png image, on XCode 12GM.

I get, without any locale added :
Code Block
{
"images" : [
{
"filename" : "image.png",
"idiom" : "universal",
"scale" : "1x"
},
{
"idiom" : "universal",
"scale" : "2x"
},
{
"idiom" : "universal",
"scale" : "3x"
}
],
"info" : {
"author" : "xcode",
"version" : 1
}
}


To be sure, I also did the following:
  • copy first the image in resources

  • drag from there into xcassets.

Same result.

I searched in reference and could not find the "locale" key
https://developer.apple.com/library/archive/documentation/Xcode/Reference/xcode_ref-Asset_Catalog_Format/Contents.html

and here more specifically, where we find "author", "version", "idiom", "filename" … but not "locale"
https://developer.apple.com/library/archive/documentation/Xcode/Reference/xcode_ref-Asset_Catalog_Format/ImageSetType.html#//apple_ref/doc/uid/TP40015170-CH25-SW1


I would thus either file a bug report (at least against this documentation" or contact Apple support.
Deleted
Got same bug. I added pictures from folder(draged) and i can't use them until delete line "locale". Xcode 12.3
Xcode adding strange locale to images in xcassets
 
 
Q