Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • Users
  • Groups
  • Search
  • Get Qt Extensions
  • Unsolved
Collapse
Brand Logo
  1. Home
  2. Qt Development
  3. General and Desktop
  4. Logging failure of commands
Qt 6.11 is out! See what's new in the release blog

Logging failure of commands

Scheduled Pinned Locked Moved Unsolved General and Desktop
4 Posts 2 Posters 738 Views 1 Watching
  • Oldest to Newest
  • Newest to Oldest
  • Most Votes
Reply
  • Reply as topic
Log in to reply
This topic has been deleted. Only users with topic management privileges can see it.
  • KiraK Offline
    KiraK Offline
    Kira
    wrote on last edited by VRonin
    #1

    Hello Everyone,

    I am facing issue where i am taking images from camera and saving them in a folder the folder is sometimes the image save operation fails. I am using the following commands to save the image.

     if(imwrite(filename, matframe)){
                qDebug(logInfo())<<"Image Saved : "<<counter<<" Times";
                counter++;
            }else{
                qDebug(logCritical())<<"Failed to save Image "<<failCounter<<" Times";
                failCounter++;
            }
    

    When i check the logs it shows the image have been saved in the folder. When i open the folder some of the image files are missing.

    Is there any way to exactly determine when the error is happening.

    1 Reply Last reply
    0
    • VRoninV Offline
      VRoninV Offline
      VRonin
      wrote on last edited by
      #2

      imwrite is a Matlab function, not a Qt one. I think you are in the wrong place to ask this question

      "La mort n'est rien, mais vivre vaincu et sans gloire, c'est mourir tous les jours"
      ~Napoleon Bonaparte

      On a crusade to banish setIndexWidget() from the holy land of Qt

      KiraK 1 Reply Last reply
      0
      • VRoninV VRonin

        imwrite is a Matlab function, not a Qt one. I think you are in the wrong place to ask this question

        KiraK Offline
        KiraK Offline
        Kira
        wrote on last edited by
        #3

        @VRonin : Thanks for the reply.

        Actually i was referencing any function which we want to monitor either qt or c++ or any library which we use. Whether is there any feature where i can catch the run time error if the function produces.
        We can use try catch but wanted to know is there any more effective way in Qt doing the same.

        1 Reply Last reply
        0
        • VRoninV Offline
          VRoninV Offline
          VRonin
          wrote on last edited by
          #4

          Actually, turns out there's also a function with the same name in opencv but once again you are in the wrong place. The management of errors is 100% dependant on the implementation of that function.

          If it can help, see https://stackoverflow.com/questions/22369168/opencv-imwrite-not-saving-image

          "La mort n'est rien, mais vivre vaincu et sans gloire, c'est mourir tous les jours"
          ~Napoleon Bonaparte

          On a crusade to banish setIndexWidget() from the holy land of Qt

          1 Reply Last reply
          1

          • Login

          • Login or register to search.
          • First post
            Last post
          0
          • Categories
          • Recent
          • Tags
          • Popular
          • Users
          • Groups
          • Search
          • Get Qt Extensions
          • Unsolved