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
Forum Updated to NodeBB v4.3 + New Features

Logging failure of commands

Scheduled Pinned Locked Moved Unsolved General and Desktop
4 Posts 2 Posters 658 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.
  • K Offline
    K Offline
    Kira
    wrote on 14 Mar 2018, 07:55 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
    • V Offline
      V Offline
      VRonin
      wrote on 14 Mar 2018, 09:03 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

      K 1 Reply Last reply 14 Mar 2018, 09:17
      0
      • V VRonin
        14 Mar 2018, 09:03

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

        K Offline
        K Offline
        Kira
        wrote on 14 Mar 2018, 09:17 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
        • V Offline
          V Offline
          VRonin
          wrote on 14 Mar 2018, 09:33 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

          3/4

          14 Mar 2018, 09:17

          • Login

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