Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Need image sorting settings #196

Closed
wyatt8740 opened this issue Jun 13, 2016 · 4 comments
Closed

Need image sorting settings #196

wyatt8740 opened this issue Jun 13, 2016 · 4 comments

Comments

@wyatt8740
Copy link

I often browse files in a file manager sorting by file name. I have images set to open in leafpic so I can swipe back and forth and view other images in the directory. However, leafpic sorts by modification date (I think), and there is no setting to change this behaviour that I can find. Please consider implementing some more options, like sorting by name or maybe by filetype.

@wyatt8740
Copy link
Author

wyatt8740 commented Jun 13, 2016

for now I'm using a horrid little hack to accomplish what I want by doctoring modification times, but I'd love to have this done right instead.

#! /system/bin/sh
#hack to sort photos by name in programs that use dates.
export ITERSEC=59
export ITERMIN=59
export ITERHOUR=23
typeset -Z 2 PADSEC
typeset -Z 2 PADMIN
typeset -Z 2 PADHR
PADSEC=$ITERSEC
for file in *; do
    PADHR=$ITERHOUR
    PADMIN=$ITERMIN
    PADSEC=$ITERSEC
    PADNUM=$PADHR$PADMIN$PADSEC
    touch -t 19700101.$PADNUM "$file"
    ITERSEC=`expr $ITERSEC - 1`
    if [ "$ITERSEC" -eq "0" ]; then
        ITERMIN=`expr $ITERMIN - 1`
        ITERSEC=60
    fi
    if [ "$ITERMIN" -eq "0" ]; then
        ITERHOUR=`expr $ITERHOUR - 1`
        ITERMIN=60
    fi
done

Or reverse order:

#! /system/bin/sh
#hack to sort photos by name in programs that use dates.
export ITERSEC=1
export ITERMIN=0
export ITERHOUR=0
typeset -Z 2 PADSEC
typeset -Z 2 PADMIN
typeset -Z 2 PADHR
PADSEC=$ITERSEC
for file in *; do
    PADHR=$ITERHOUR
    PADMIN=$ITERMIN
    PADSEC=$ITERSEC
    PADNUM=$PADHR$PADMIN$PADSEC
    touch -t 19700101.$PADNUM "$file"
    ITERSEC=`expr $ITERSEC + 1`
    if [ "$ITERSEC" -eq "60" ]; then
        ITERMIN=`expr $ITERMIN + 1`
        ITERSEC=0
    fi
    if [ "$ITERMIN" -eq "60" ]; then
        ITERHOUR=`expr $ITERHOUR + 1`
        ITERMIN=0
    fi
done

@dnldsht
Copy link
Member

dnldsht commented Jun 13, 2016

Yeah LeafPic sort images by date modified by default.
now you can sort your media only if you open albums from the app
I'm gonna add that option also when you are on the single photo view (ViewPager), so you can sort them even if you open from another app.

EDIT: I will also add filetype option!

@wyatt8740
Copy link
Author

That sounds great; I'll be glad when I can stop forging modification times.

Perhaps a setting to control whether sorting is 'case sensitive' would be helpful, too, since file managers handle that differently?

Thanks for the fast response!

@dnldsht
Copy link
Member

dnldsht commented Jun 16, 2016

check out new version sort available on the single photo view also file type option!

I dont get why file managers are key sensitive when sorting stuff IMO it has no sense.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants