This is a wish or a suggestion. I do have a lot (several thousand) scanned images from slides. Due to the scan process, they are all in landscape orientation. Just like a scan for faces or objects, I would like to have digikam tag all pictures that are in portrait format.
(In reply to Braun.Lot from comment #0) > This is a wish or a suggestion. > I do have a lot (several thousand) scanned images from slides. Due to the > scan process, they are all in landscape orientation. > Just like a scan for faces or objects, I would like to have digikam tag all > pictures that are in portrait format. Hello Braun, Please help me understand your request. Is the goal to find all the images so you can rotate them to the correct orientation? Cheers, Mike
Hello Mike, to put it in other words: All Images are in Landscape orientation. I would like for digikam to set the correct orientation flag. (Or at least to flag every picture which seams to have a wrong orientation flag) Hope that is better phrased. Cheers Lothar
(In reply to Braun.Lot from comment #2) > Hello Mike, > to put it in other words: > All Images are in Landscape orientation. I would like for digikam to set the > correct orientation flag. > (Or at least to flag every picture which seams to have a wrong orientation > flag) > Hope that is better phrased. > Cheers > Lothar Hi Lothar, We are introducing an AI based auto-rotate function in digiKam 8.7.0. digiKam examines the image and automatically rotates the image to the correct orientation. You can try it now in the digiKam 8.7.0 daily builds. Will this help? Cheers, Mike
Hello Mike, sounds really good! Could you link it to this bug so I know when to try it? Thanks a lot Lothar
Hi, The code is already compiled with this new feature in the pre-release build available here : https://files.kde.org/digikam/ Best Gilles Caulier
Hi Lothar, You can try it now. It was added last week. Download the latest pre-release version of digiKam 8.7.0 https://files.kde.org/digikam/ Here's a quick demo: https://imgur.com/a/OXcvybd Cheers, Mike
Hi Mike, this would be just the feature I am looking for - if it would work somewhat reliable. Is there any chance to train it, or do you need some test data? With my tiff files it is (sadly) unusable. cheers Lothar PS An additional request would be to add it to the maintenance pipeline.
(In reply to Braun.Lot from comment #7) > Hi Mike, > this would be just the feature I am looking for - if it would work somewhat > reliable. > Is there any chance to train it, or do you need some test data? With my tiff > files it is (sadly) unusable. > cheers > Lothar > > PS An additional request would be to add it to the maintenance pipeline. Hi Lothar, Can you please try it with a single image, and not multiple selected images? Also, do you mind sending me a copy of a file that's not working? Cheers, Mike
Hi Mike, the images are about 100 MB each. so just a Link: https://magentacloud.de/s/ZbCLwrii5DMPjEG Bild025.tif is not rotated (false) Bild033.tif is rotated (false positive) Bild034.tif is always rotated (portrait/landscape/portrait/landscape/...) Everything tested with single select and rotated with ctrl/shift up
(In reply to Braun.Lot from comment #9) > Hi Mike, > the images are about 100 MB each. so just a Link: > https://magentacloud.de/s/ZbCLwrii5DMPjEG > Bild025.tif is not rotated (false) > Bild033.tif is rotated (false positive) > Bild034.tif is always rotated (portrait/landscape/portrait/landscape/...) > Everything tested with single select and rotated with ctrl/shift up Hi Lothar, I'm working on the autorotate problem. It looks like the .tiff image isn't being loaded correctly. As a test, can you please save a few of the .tiff files as jpeg and then try the autorotate feature on the jpegs? I tried this with same sample images you sent (thank you!), and autorotate was 100% accurate (3 images is not a good sample size). Meanwhile, I'll keep looking at why the .tiff files aren't loading correctly. Cheers, Mike
Hi Mike, converted to jpg they work much better. But to do a bulk test it would be nice to can at least mark 100 files in one album and not to rotate every single one. I tried to convert them using irfanview but got no reasonable results - something off with the color. ImageMagick worked like a treat. I will add two more files in the next minutes, both tiff and jpg, to the linked directory. Bild009 does not get rotated and Bild026 gets upside down. I have no problem to provide more examples if that helps. Cheers and thank you for your patience and the good work Lothar
(In reply to Braun.Lot from comment #11) > Hi Mike, > converted to jpg they work much better. But to do a bulk test it would be > nice to can at least mark 100 files in one album and not to rotate every > single one. > > I tried to convert them using irfanview but got no reasonable results - > something off with the color. > ImageMagick worked like a treat. > > I will add two more files in the next minutes, both tiff and jpg, to the > linked directory. Bild009 does not get rotated and Bild026 gets upside down. > I have no problem to provide more examples if that helps. > Cheers and thank you for your patience and the good work > Lothar Hi Lothar, I found the problem and I'm working on a fix now. The problem is the tiffs are 16 bit, and the AI model wants 8 bit images. My code to convert an image from 16 bit to 8 bit had a flaw in it which made the 8 bit image I was passing to the AI model unreadable. The fix should be added to digiKam in a day or so. Once it's added, you will be able to use your original source Tiffs without a problem. > Bild009 does not get rotated and Bild026 gets upside down. The AI isn't 100% accurate, but testing has proven it is well over 95% accurate. Sometimes you need to run autorotate on the image again, and sometimes the AI just can't figure it out. Cheers, Mike
Git commit 0cb188620947be6e6fc87058287ffa411440d606 by Michael Miller. Committed on 03/04/2025 at 22:40. Pushed by michmill into branch 'master'. fix 16 to 8 bit conversion when creating a cv::Mat FIXED-IN: 8.7.0 M +32 -5 core/libs/autorotator/autorotator.cpp M +46 -15 core/libs/qtopencvimg/qtopencvimg.cpp M +0 -1 core/libs/qtopencvimg/qtopencvimg.h https://invent.kde.org/graphics/digikam/-/commit/0cb188620947be6e6fc87058287ffa411440d606
Hi Lothar, The fix should be in the daily build available Saturday. Please let me know if you have any problems or questions. Thanks for your help! Cheers, Mike
Hi Mike, just checked and it is really good! Thank you. I am not sure about it, but it seems to me, that there are a few (just two or three out of 100) images which give different results for tiff and jpg format. I will have a closer look at that, but the next point is much more important for me: I would really appreciate it, if I could let it run over at least a hundred, better a few thousand pictures. Is that planned? Marking all thumbnails in thumbnail view is possible, but does not give correct results. Should I file a new bug for that? Thank you very much Lothar
(In reply to Braun.Lot from comment #15) > Hi Mike, > just checked and it is really good! Thank you. > > I am not sure about it, but it seems to me, that there are a few (just two > or three out of 100) images which give different results for tiff and jpg > format. > I will have a closer look at that, but the next point is much more important > for me: > > I would really appreciate it, if I could let it run over at least a hundred, > better a few thousand pictures. > Is that planned? > Marking all thumbnails in thumbnail view is possible, but does not give > correct results. > Should I file a new bug for that? > > Thank you very much > Lothar Hi lothar, > I am not sure about it, but it seems to me, that there are a few (just two > or three out of 100) images which give different results for tiff and jpg > format. That sounds about right for the accuracy of the AI model. Unfortunately no AI is going to be 100% perfect. > I would really appreciate it, if I could let it run over at least a hundred, > better a few thousand pictures. > Is that planned? Have you tried the Batch Queue Manager for processing a large number of files? Make sure you read the BQM documentation first. The default behavior is to create new copies of the modified image, and that may not be what you want. https://docs.digikam.org/en/batch_queue.html > Marking all thumbnails in thumbnail view is possible, but does not give > correct results. > Should I file a new bug for that? Yes, please. This will help us track the fix for multiple images selected in the thumbnail view. Thanks for helping us out! Cheers, Mike