google-ar / arcore-unity-sdk

ARCore SDK for Unity
https://developers.google.com/ar
Other
1.4k stars 400 forks source link

Not supported image format error when the image has an uppercase filename extension #610

Open klemiba opened 5 years ago

klemiba commented 5 years ago

SPECIFIC ISSUE ENCOUNTERED

Not supported image format: Assets/GoogleARCore/Examples/AugmentedImage/Images/qrtestjpg.JPG.

BuildFailedException: Temp/UnityTempFile-367f66ed52b97c049a164de835e8b07e\inputImages:line 1: Not supported image format: Assets/GoogleARCore/Examples/AugmentedImage/Images/qrtestjpg.JPG. GoogleARCoreInternal.AugmentedImageDatabasePreprocessBuild.OnPreprocessBuild (UnityEditor.BuildTarget target, System.String path) (at E:/#Unity/Augmented Image testing/Assets/GoogleARCore/SDK/Scripts/Editor/AugmentedImageDatabasePreprocessBuild.cs:44) GoogleARCoreInternal.PreprocessBuildBase.OnPreprocessBuild (UnityEditor.Build.Reporting.BuildReport report) (at E:/#Unity/Augmented Image testing/Assets/GoogleARCore/SDK/Scripts/Editor/PreprocessBuildBase.cs:52) UnityEditor.Build.BuildPipelineInterfaces+cAnonStorey0.<>m1 (UnityEditor.Build.IPreprocessBuildWithReport bpp) (at C:/buildslave/unity/build/Editor/Mono/BuildPipeline/BuildPipelineInterfaces.cs:376) UnityEditor.Build.BuildPipelineInterfaces.InvokeCallbackInterfacesPair[T1,T2] (System.Collections.Generic.List1[T] oneInterfaces, System.Action1[T] invocationOne, System.Collections.Generic.List1[T] twoInterfaces, System.Action1[T] invocationTwo, System.Boolean exitOnFailure) (at C:/buildslave/unity/build/Editor/Mono/BuildPipeline/BuildPipelineInterfaces.cs:356) UnityEditor.BuildPlayerWindow:BuildPlayerAndRun()

VERSIONS USED

STEPS TO REPRODUCE THE ISSUE

  1. Save a .JPG or .PNG file to Assets\GoogleARCore\Examples\AugmentedImage\Images
  2. Right Click image -> Create -> Google ARCore -> Augmented Image Database
  3. Rename the created database
    1. In AugmentedImageSessionConfig pick the new database through the Augmented Image Database public variable
    2. Build & Run project

WORKAROUNDS (IF ANY)

Changing the file ending from .JPG to .jpg.

nGrave commented 5 years ago

Thank you. Spent 40 mins trying to figure this out.

mr-funt commented 4 years ago

The issue is caused by arcoreimg binary which actually builds AugmentedImageDatabase. arcoreimg.exe build-db --input_image_list_path=/path/to/image_list_file.txt --output_db_path=/path/to/myimages.imgdb

the image_list_file.txt contains lines like this: mouse|path/to/mouse.png|0.1 little dog|/path/to/dog.jpg

Each line represents - name | file path | (optional) physical width as float

If something is wrong with any parameter like file format, float having comma "," instead of dot "." - happens for instance in EU countries due to default toString() in case of float - then the database is not created/update and images are not recognized by ARCore.