Searching for files with a certain exposure time ?

General discussion related to "Everything".
Post Reply
shodan
Posts: 40
Joined: Wed Mar 17, 2021 8:40 am

Searching for files with a certain exposure time ?

Post by shodan »

Hi,

I wasn't having a discussion about Everything and linux search counterparts

https://lemmy.ml/post/35664182/20873413

And kind of as a joke, when I saw that Everything can sort by "exposure time"

I was curious to find if it's possible ?

It seems you can put them in order of exposure time, but not search by exposure time ?

Is that correct or did I miss the boat on that one ?

I think it would be something like

Code: Select all

pic: path:"C:\pics" sort:da-descending ExposureTime:1/20..1/100
Oh and on linux it would be something like this, I wanted to illustrate how much easier it was in everything

Code: Select all

find /pics/ -type f \( -iname '*.jpg' -o -iname '*.jpeg' -o -iname '*.png' \) \
  -exec exiftool -ExposureTime -T {} \; -exec bash -c '
    file="$1"
    exposure="$2"

    # Convert exposure to decimal
    if [[ "$exposure" =~ ^([0-9]+)/([0-9]+)$ ]]; then
        num="${BASH_REMATCH[1]}"
        denom="${BASH_REMATCH[2]}"
        exposure_val=$(echo "$num / $denom" | bc -l)
    else
        exposure_val="$exposure"
    fi

    # Filter by exposure between 1/100 and 1/20 seconds
    if (( $(echo "$exposure_val >= 0.01" | bc -l) )) && (( $(echo "$exposure_val <= 0.05" | bc -l) )); then
        atime=$(stat -c %X "$file")  # Access time (epoch)
        echo "$atime $file"
    fi
  ' bash {} $(exiftool -s3 -ExposureTime {}) | sort -nr


NOTE : I don't personnally need to find my files with an exposure between 1/20 and 1/100, it was just to illustrate something relatively obscure fits in to everything
void
Developer
Posts: 19830
Joined: Fri Oct 16, 2009 11:31 pm

Re: Searching for files with a certain exposure time ?

Post by void »

ExposureTime:1/20..1/100
This worked for me, are you seeing incorrect results?

exposure-time:
shodan
Posts: 40
Joined: Wed Mar 17, 2021 8:40 am

Re: Searching for files with a certain exposure time ?

Post by shodan »

Oh my !
I'm sorry, it DOES work !

Code: Select all

ExposureTime:1/20..1/100
I must have done something wrong the first time I had no results !

This program just keeps impressinve me, well done, I will miss it so much when I switch to linux !
Post Reply