Skip to main content
Andrei Chichak
Lead
November 14, 2024
Solved

Bitmap metadata not getting deleted from BitmapDatabase.hpp/cpp

  • November 14, 2024
  • 19 replies
  • 3750 views

I am having an issue adding a bitmap into my project, its ID doesn't seem to get added into the bitmap database, but in debugging this I noticed that there is a bunch of info from a bunch of bitmaps that got deleted from the project long ago.

I go into images, hit +, point the file picker at my .png file, add it in, looks great, put in a screen, looks great. Generate code, compile the code, compiler can't resolve the symbol for the bitmap ID. Grr.

Maybe I just don't understand how these files work, but they do say that I should not edit them since they are generated by imageconverter. I expect that the database is borked, but if I delete it, and generate code, that makes a bigger mess. Apparently there is a trick that I don't know.

Okay, how do I fire up imageconverter so that my bitmap gets an ID and the old stuff gets deleted?

(4.24.1)

    This topic has been closed for replies.
    Best answer by Andrei Chichak

    I got it! You won't believe this.

    When Designer was generating the assets it was tripping over the Thumbs.db file in assets/images and not altering any assets in the generated/images folder. (The images folder holds the .cpp/.hpp files for the converted image bitmaps.)

    If I blow away the Thumbs.db file, make a trivial change to my screen, and regenerate the code, now I can see that the previous image files and data are removed and my new bitmaps get incorporated.

    Microsoft lets us know that the Thumbs.db files (hidden) are regenerated automatically if they are removed, so I guess ST will have to deal with those in imageconverter.

    Thanks for your help.

    19 replies

    ferro
    Lead
    November 14, 2024

    Hi@Andrei Chichak ,

    try to delete the whole folder

    \TouchGFX\generated

    and build application again in GfxDesigner. What you describe seems similar to what I experienced few times. It seems the Designer sometimes gets confused and it needs to start from scretch.

     

    Andrei Chichak
    Lead
    November 14, 2024

    Unfortunately no. When it  regenerated, the previous cruft was regenerated as well.

    Plus it didn't generate a new images folder. Sigh.

    But thanks for the idea.

    ferro
    Lead
    November 14, 2024

    "it didn't generate a new images folder"

    Hm, not sure what folder that might be. From my experience, with nothing else changed, generated content of this folder is always the same. It should be, right ?

    ferro
    Lead
    November 14, 2024

    Could be that the compiler object *.o files are not deleted ?

    Andrei Chichak
    Andrei ChichakAuthorBest answer
    Lead
    November 14, 2024

    I got it! You won't believe this.

    When Designer was generating the assets it was tripping over the Thumbs.db file in assets/images and not altering any assets in the generated/images folder. (The images folder holds the .cpp/.hpp files for the converted image bitmaps.)

    If I blow away the Thumbs.db file, make a trivial change to my screen, and regenerate the code, now I can see that the previous image files and data are removed and my new bitmaps get incorporated.

    Microsoft lets us know that the Thumbs.db files (hidden) are regenerated automatically if they are removed, so I guess ST will have to deal with those in imageconverter.

    Thanks for your help.

    ferro
    Lead
    November 14, 2024

    Very interesting, thanks for sharing. See it. Say it. Sorted. Perfect world.

    GaetanGodart
    ST Employee
    November 15, 2024

    Hello @Andrei Chichak ,

     

    When you say "the compiler can't resolve the symbol for the bitmap ID", I assume you get an error message, could you share it please?

    If you create a new project, are you able to reproduce the issue? If you can, what are the steps to reproduce it?

    To fire up imageconverter, you can check this .

     

    Regards,

    Gaetan GodartSoftware engineer at ST (TouchGFX)
    Andrei Chichak
    Lead
    November 15, 2024

    I'm attempting to reproduce the issue with a new project. It SHOULD blow up, but I have to wait for Windows (10)  to create the Thumbs.db file.

    FYI, overnight Windows created the Thumbs.db file in my original project's folder and this morning the problem is back, as we can see:

    Generate Assets
    make -f simulator/gcc/Makefile assets -j8
    Reading ./application.config
    Reading ./target.config
    ERROR: assets/images/Thumbs.db not supported by image converter
    generated/simulator/gcc/Makefile:221: recipe for target 'images' failed
    make[1]: *** [images] Error 1
    make[1]: *** Waiting for unfinished jobs....
    simulator/gcc/Makefile:32: recipe for target 'assets' failed
    make: *** [assets] Error 2
    Failed

    I'll give more information when I can get the issue to appear in a new project, but for now I can say that this shouldn't happen if you are using Linux for your test system. Thumbs.db is a Windows system file, not Linux, not MacOS.

    ferro
    Lead
    November 15, 2024

    I just copied a 'random file' readme.md into assets/images and I get the same error. Maybe a rule to accept only specific file types is needed.

     

    Run Simulator
     Generate
     Done
     Generate Assets
     make -f simulator/gcc/Makefile assets -j8
     Reading ./application.config
     Reading ./target.config
     ERROR: assets/images/README.md not supported by image converter
     generated/simulator/gcc/Makefile:221: recipe for target 'images' failed
     make[1]: *** [images] Error 1
     make[1]: *** Waiting for unfinished jobs....
     simulator/gcc/Makefile:45: recipe for target 'assets' failed
     make: *** [assets] Error 2
     Failed
     Failed

     

     

     

    Andrei Chichak
    Lead
    December 13, 2024

    Hello @GaetanGodart,

    Yes, I got around the issue. The "best" answer would be for the Designer team to take a look at their scripts and only try and convert graphics files instead of any files in the directory. Remember, I did nothing to put the extra file in the directory, it's a normal Windows operation.

    But for this instance of the issue, I will choose from the responses.

    Merci and salut,

     

    Andrei

    GaetanGodart
    ST Employee
    December 19, 2024

    Hello @Andrei Chichak ,

     

    I understand the issue and will talk with the team to see if we can fix it.

     

    Regards,

    Gaetan GodartSoftware engineer at ST (TouchGFX)
    GaetanGodart
    ST Employee
    March 5, 2025

    Hello @Andrei Chichak and @ferro ,

     

    TouchGFX 4.25.0 fixes this issue.
    It is now possible to generate assets even if a Thumbs.db files is in the folder.

     

    Regards,

    Gaetan GodartSoftware engineer at ST (TouchGFX)
    Andrei Chichak
    Lead
    March 6, 2025

    Your people made an interesting decision in overcoming this issue. Rather than only processing files that the  asset generator  can deal with, they ignore "Thumbs.db" and use any other files as input. In this case, a file called "fu.txt" will still trigger the issue, as pointed out by @ferro .

    I suppose the fix is verified, as "Thumbs.db" is created by the operating system and other files would be created by the users.

    GaetanGodart
    ST Employee
    March 7, 2025

    Hello @Andrei Chichak ,

     

    Indeed we only check for the Thumbs.db file because it seems to be the only one that is generated by windows.

    While we could have limited our verification to supported files only, we chose to provide feedback to the user in case they upload an unsupported file, such as a JPG file. This approach ensures that the user receives a message indicating that the format is not supported.

     

    Regards,

    Gaetan GodartSoftware engineer at ST (TouchGFX)