Announcement

Collapse
No announcement yet.

Multithreading for batch conversion

Collapse
X
 
  • Filter
  • Time
  • Show
Clear All
new posts

    Forwarded Multithreading for batch conversion

    As the CPU clock frequencies aren't really growing that much anymore and the number of cores is increasing, it would be really good if IrfanView could run batch conversion operations in multiple threads. This can be simulated by starting multiple copies of the program but that's quite a hassle and has lots of overhead. Batch conversion would be an excellent feature for piloting multicore support.

    #2
    Yes, If not possible to use more than one core to process an image. Maybe Irfanview can detect the number of core and start n process like n core we have.

    Comment


      #3
      Hi,

      as far as I know Irfan hasn't planned to implement multiple threads. IrfanView is mainly a small and fast picture viewer, it has some functions for converting. But using multiple threads is something which would blow up the code and so I don't think this is something with a high priority on Irfan's to do list.

      But feel free to send Irfan a request.

      Best regards, Nils.

      Comment


        #4
        Originally posted by ZeroOne View Post
        As the CPU clock frequencies aren't really growing that much anymore and the number of cores is increasing, it would be really good if IrfanView could run batch conversion operations in multiple threads. This can be simulated by starting multiple copies of the program but that's quite a hassle and has lots of overhead. Batch conversion would be an excellent feature for piloting multicore support.
        I have run 2 copies of Irfanview together doing Batch processing using both cores of my processor. It was not that much hassle to set up. Well worth the time saving when processing a lot of files.

        Comment


          #5
          Originally posted by derniwi View Post
          as far as I know Irfan hasn't planned to implement multiple threads. IrfanView is mainly a small and fast picture viewer, it has some functions for converting. But using multiple threads is something which would blow up the code and so I don't think this is something with a high priority on Irfan's to do list.
          Well, I sent a message to Irfan and I'm glad to report that you are wrong. Irfan does have multicore support at his TODO-list and he also mentioned that it would not blow up the code.

          Comment


            #6
            Good to hear. :-) Sometimes I'm lucky if I'm wrong... :-D

            Comment


              #7
              This would be a kick ass feature! Maybe with option to select how many cores to use. Some times I have to convert as much as 1000 pics (give or take 100) and running 4 irfanview simultaneously isnt something I'd call hassle-free Also I'm impressed by the memory usage of irfanview. I recently ditched Adobe Lightroom, since it hogged over 6gigabytes (!!!) memory while converting pictures. It also seem to be stripping vital exif data, which can be saved in irfanview. Great job!

              Comment


                #8
                fantastic idea. if implemented multithreading will/can greatly improve the thumbnail generating engine as well, for folder with large number of pics.

                Comment


                  #9
                  pls dont run multipage (tifs/pdfs) conversion simultaneously.
                  about 10% images will be mixed up..(second page of doument A will become 3page of doument B,and so on).
                  the no of pages in a document will remain same. so you will think everything is ok
                  but beware.
                  ...see my post in bugreports
                  Last edited by Bhikkhu Pesala; 25.11.2017, 06:27 PM.

                  Comment


                    #10
                    Multi-threaded batch conversion

                    Could you please add multi-thread support for batch conversion? I use IrfanView frequently for viewing photos as well as convert them to a lower resolution for archive. I will reduce the jpg quality as well as setting the images to lower MegaPixel. The conversion process is single-threaded.

                    I tried to use the command line and launch several conversion tasks at once but I couldn't find the "set image size to x MegaPixels" parameters. The system nowadays should be able to handle multiple conversions at once. I do suggest to have a numeric field to determine the number of threads (instead of auto-detecting the number of thread available in the system, since one may want to limit the use of threads for conversion)

                    Comment


                      #11
                      Multithreading for batch conversion

                      It's 2020 and I'm still using IrfanView, as it's simply the best out there

                      However, it's 2020, and consumer-devices regularly have 16 cores, 32 threads or even more, and IrfanView Batchconversion is still running on a single thread.

                      Don't you think it might be something that could be implemented soon? I know this requires some major changes (as I requested about it 5 years, and 10 years ago), however, I think it would be worth it.

                      Could it not be an option to use just use the already built-in command line options, and spin up a separate instance for each image? or run several batch-instances simultaneously via the CLI?

                      Comment


                        #12
                        Originally posted by skjerns View Post
                        Could it not be an option to use just use the already built-in command line options?(...)
                        my command line example for 999 .JPG files, in a single folder, converting to jpgquality 80:
                        cmd must be run with variable's delayed expansion
                        Code:
                        cmd /v:on

                        Code:
                        set filenum=999
                        
                        set /a flnrdiv=!filenum!/%NUMBER_OF_PROCESSORS%+1
                        
                        (echo skip first row && dir /b /a-d *.jpg *.jpeg *.jpe|findstr /i /n /e ".jpg .jpe .jpeg") >lstflnm.txt
                        
                        for /l %I in (1,1,%NUMBER_OF_PROCESSORS%) do @((set /a skip=!flnrdiv!*^(%I-1^)+1 >nul)&&(set /a limit=!skip!+!flnrdiv!-1 >nul)&&(cmd /c "(for /f "skip=!skip! tokens=1* delims=:" %A in (lstflnm.txt) do @if /i %A LEQ !limit! echo %B)>lstcore%I.txt"))
                        
                        rem !!!CAUTION!!! below command overwrites files. You should write your own version of these parameters, instead of "/convert=$D$F /jpgq=80"
                        for /l %I in (1,1,%NUMBER_OF_PROCESSORS%) do @"c:\program files\irfanview\i_view64.exe" /filelist=lstcore%I.txt /convert=$D$F /jpgq=80
                        first "for" splits fileslist into several lists, one for each thread
                        second "for" runs irfanview instance for each list simultaneously

                        TRY TO DO STEPS EXCEPT LAST ONE AND CHECK HOW MANY lstcoreX.txt FILES IT CREATES AND WHAT THEY CONTAIN
                        Last edited by ornptr; 06.09.2021, 09:56 AM.

                        Comment

                        Working...
                        X