Searching Files according to PNG Meta-Tags












2















I want to search for PNG's in a (sub-)folder structure with the meta tag software set to the value GNOME::ThumbnailFactory and delete them with a single bash command.



Have the story behind it, you can skip that if you want:

I scrapped my Ubuntu ext filesystem by formatting the drive, and then decided to save my files with PhotoRec. My problem now is that now I have all my files wildly distributed in some sub-folders, and guess it, the hidden Gnome Thumbnail folder is also evenly distributed in it and way larger than the original files because it also indexed my external harddrive I had mounted on it sometimes. I found out all of them had the PNG Software Tag set to the GNOME::ThumbnailFactory value by looking at some of them with ExifToolGUI in Windows, but I'm not able to find out how I can do that and delete them according to the results with a Linux Command Line Tool, and I'm not very proficient with grep to be honest.










share|improve this question





























    2















    I want to search for PNG's in a (sub-)folder structure with the meta tag software set to the value GNOME::ThumbnailFactory and delete them with a single bash command.



    Have the story behind it, you can skip that if you want:

    I scrapped my Ubuntu ext filesystem by formatting the drive, and then decided to save my files with PhotoRec. My problem now is that now I have all my files wildly distributed in some sub-folders, and guess it, the hidden Gnome Thumbnail folder is also evenly distributed in it and way larger than the original files because it also indexed my external harddrive I had mounted on it sometimes. I found out all of them had the PNG Software Tag set to the GNOME::ThumbnailFactory value by looking at some of them with ExifToolGUI in Windows, but I'm not able to find out how I can do that and delete them according to the results with a Linux Command Line Tool, and I'm not very proficient with grep to be honest.










    share|improve this question



























      2












      2








      2


      1






      I want to search for PNG's in a (sub-)folder structure with the meta tag software set to the value GNOME::ThumbnailFactory and delete them with a single bash command.



      Have the story behind it, you can skip that if you want:

      I scrapped my Ubuntu ext filesystem by formatting the drive, and then decided to save my files with PhotoRec. My problem now is that now I have all my files wildly distributed in some sub-folders, and guess it, the hidden Gnome Thumbnail folder is also evenly distributed in it and way larger than the original files because it also indexed my external harddrive I had mounted on it sometimes. I found out all of them had the PNG Software Tag set to the GNOME::ThumbnailFactory value by looking at some of them with ExifToolGUI in Windows, but I'm not able to find out how I can do that and delete them according to the results with a Linux Command Line Tool, and I'm not very proficient with grep to be honest.










      share|improve this question
















      I want to search for PNG's in a (sub-)folder structure with the meta tag software set to the value GNOME::ThumbnailFactory and delete them with a single bash command.



      Have the story behind it, you can skip that if you want:

      I scrapped my Ubuntu ext filesystem by formatting the drive, and then decided to save my files with PhotoRec. My problem now is that now I have all my files wildly distributed in some sub-folders, and guess it, the hidden Gnome Thumbnail folder is also evenly distributed in it and way larger than the original files because it also indexed my external harddrive I had mounted on it sometimes. I found out all of them had the PNG Software Tag set to the GNOME::ThumbnailFactory value by looking at some of them with ExifToolGUI in Windows, but I'm not able to find out how I can do that and delete them according to the results with a Linux Command Line Tool, and I'm not very proficient with grep to be honest.







      files file-metadata png






      share|improve this question















      share|improve this question













      share|improve this question




      share|improve this question








      edited Feb 10 at 19:17









      Rui F Ribeiro

      40.5k1479137




      40.5k1479137










      asked Mar 8 '16 at 14:07









      uncannyuncanny

      37117




      37117






















          1 Answer
          1






          active

          oldest

          votes


















          1














          You can do this using ImageMagick. Once ImageMagick is installed, use command identify -verbose image.jpg and pick what you want from the output using grep



          find / -name "*.png" -exec sh -c '
          if identify -verbose "${file}" | grep your_pattern_here
          then
          echo "${file}" # or do something else here, e.g. rm
          fi
          ' {} ;





          share|improve this answer


























          • Doesn't that only put the result for one image? I want to search them according to said tag

            – uncanny
            Mar 8 '16 at 14:56











          • Yeah... that is what a for loop for. You can loop through files one by one, as it should be done. See my updates in the answer above

            – MelBurslan
            Mar 8 '16 at 15:01













          Your Answer








          StackExchange.ready(function() {
          var channelOptions = {
          tags: "".split(" "),
          id: "106"
          };
          initTagRenderer("".split(" "), "".split(" "), channelOptions);

          StackExchange.using("externalEditor", function() {
          // Have to fire editor after snippets, if snippets enabled
          if (StackExchange.settings.snippets.snippetsEnabled) {
          StackExchange.using("snippets", function() {
          createEditor();
          });
          }
          else {
          createEditor();
          }
          });

          function createEditor() {
          StackExchange.prepareEditor({
          heartbeatType: 'answer',
          autoActivateHeartbeat: false,
          convertImagesToLinks: false,
          noModals: true,
          showLowRepImageUploadWarning: true,
          reputationToPostImages: null,
          bindNavPrevention: true,
          postfix: "",
          imageUploader: {
          brandingHtml: "Powered by u003ca class="icon-imgur-white" href="https://imgur.com/"u003eu003c/au003e",
          contentPolicyHtml: "User contributions licensed under u003ca href="https://creativecommons.org/licenses/by-sa/3.0/"u003ecc by-sa 3.0 with attribution requiredu003c/au003e u003ca href="https://stackoverflow.com/legal/content-policy"u003e(content policy)u003c/au003e",
          allowUrls: true
          },
          onDemand: true,
          discardSelector: ".discard-answer"
          ,immediatelyShowMarkdownHelp:true
          });


          }
          });














          draft saved

          draft discarded


















          StackExchange.ready(
          function () {
          StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2funix.stackexchange.com%2fquestions%2f268399%2fsearching-files-according-to-png-meta-tags%23new-answer', 'question_page');
          }
          );

          Post as a guest















          Required, but never shown

























          1 Answer
          1






          active

          oldest

          votes








          1 Answer
          1






          active

          oldest

          votes









          active

          oldest

          votes






          active

          oldest

          votes









          1














          You can do this using ImageMagick. Once ImageMagick is installed, use command identify -verbose image.jpg and pick what you want from the output using grep



          find / -name "*.png" -exec sh -c '
          if identify -verbose "${file}" | grep your_pattern_here
          then
          echo "${file}" # or do something else here, e.g. rm
          fi
          ' {} ;





          share|improve this answer


























          • Doesn't that only put the result for one image? I want to search them according to said tag

            – uncanny
            Mar 8 '16 at 14:56











          • Yeah... that is what a for loop for. You can loop through files one by one, as it should be done. See my updates in the answer above

            – MelBurslan
            Mar 8 '16 at 15:01


















          1














          You can do this using ImageMagick. Once ImageMagick is installed, use command identify -verbose image.jpg and pick what you want from the output using grep



          find / -name "*.png" -exec sh -c '
          if identify -verbose "${file}" | grep your_pattern_here
          then
          echo "${file}" # or do something else here, e.g. rm
          fi
          ' {} ;





          share|improve this answer


























          • Doesn't that only put the result for one image? I want to search them according to said tag

            – uncanny
            Mar 8 '16 at 14:56











          • Yeah... that is what a for loop for. You can loop through files one by one, as it should be done. See my updates in the answer above

            – MelBurslan
            Mar 8 '16 at 15:01
















          1












          1








          1







          You can do this using ImageMagick. Once ImageMagick is installed, use command identify -verbose image.jpg and pick what you want from the output using grep



          find / -name "*.png" -exec sh -c '
          if identify -verbose "${file}" | grep your_pattern_here
          then
          echo "${file}" # or do something else here, e.g. rm
          fi
          ' {} ;





          share|improve this answer















          You can do this using ImageMagick. Once ImageMagick is installed, use command identify -verbose image.jpg and pick what you want from the output using grep



          find / -name "*.png" -exec sh -c '
          if identify -verbose "${file}" | grep your_pattern_here
          then
          echo "${file}" # or do something else here, e.g. rm
          fi
          ' {} ;






          share|improve this answer














          share|improve this answer



          share|improve this answer








          edited Mar 9 '16 at 0:35









          Gilles

          539k12810891606




          539k12810891606










          answered Mar 8 '16 at 14:41









          MelBurslanMelBurslan

          5,30611533




          5,30611533













          • Doesn't that only put the result for one image? I want to search them according to said tag

            – uncanny
            Mar 8 '16 at 14:56











          • Yeah... that is what a for loop for. You can loop through files one by one, as it should be done. See my updates in the answer above

            – MelBurslan
            Mar 8 '16 at 15:01





















          • Doesn't that only put the result for one image? I want to search them according to said tag

            – uncanny
            Mar 8 '16 at 14:56











          • Yeah... that is what a for loop for. You can loop through files one by one, as it should be done. See my updates in the answer above

            – MelBurslan
            Mar 8 '16 at 15:01



















          Doesn't that only put the result for one image? I want to search them according to said tag

          – uncanny
          Mar 8 '16 at 14:56





          Doesn't that only put the result for one image? I want to search them according to said tag

          – uncanny
          Mar 8 '16 at 14:56













          Yeah... that is what a for loop for. You can loop through files one by one, as it should be done. See my updates in the answer above

          – MelBurslan
          Mar 8 '16 at 15:01







          Yeah... that is what a for loop for. You can loop through files one by one, as it should be done. See my updates in the answer above

          – MelBurslan
          Mar 8 '16 at 15:01




















          draft saved

          draft discarded




















































          Thanks for contributing an answer to Unix & Linux Stack Exchange!


          • Please be sure to answer the question. Provide details and share your research!

          But avoid



          • Asking for help, clarification, or responding to other answers.

          • Making statements based on opinion; back them up with references or personal experience.


          To learn more, see our tips on writing great answers.




          draft saved


          draft discarded














          StackExchange.ready(
          function () {
          StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2funix.stackexchange.com%2fquestions%2f268399%2fsearching-files-according-to-png-meta-tags%23new-answer', 'question_page');
          }
          );

          Post as a guest















          Required, but never shown





















































          Required, but never shown














          Required, but never shown












          Required, but never shown







          Required, but never shown

































          Required, but never shown














          Required, but never shown












          Required, but never shown







          Required, but never shown







          Popular posts from this blog

          How to make a Squid Proxy server?

          Is this a new Fibonacci Identity?

          Touch on Surface Book