Finally, I know why images appears in reverse alphabetical order. It's not 
a Mezzanin issue. 
And more precisely, I understand that mezzanine use the same file order 
that the one use inside the zip archive. I discovered that with this python 
script :

from __future__ import print_function
from __future__ import unicode_literals
import zipfile
zip=zipfile.ZipFile('/tmp/images.zip')
print( zip3.namelist())

When I zipped 4 images with Nautilus ( default file browser I used in 
Ubuntu 12.04 ) the script returns :
['piroume.png', 'mouse1.png', 'elephant2.jpg', 'elephant1.jpg']

When I used zip in command line to generate my zip file, the sritp returns :
['elephant1.jpg', 'elephant2.jpg', 'mouse1.png', 'piroume.png']

In both case Mezzanine follow the order of the zip to import images.

In case that could help someone else, I made a bash script to make zip file 
with correct order to use in nautilus.
Put following lines in :  /home/user/.gnome2/nautilus-script/zip-files

#!/bin/sh
#To zip files

OUTPUT_FILENAME=$(zenity --entry \
    --text "Archive name" \
    --entry-text "compressedArchive");

if [ -z $OUTPUT_FILENAME ] ; then
    # User pressed cancel at filename dialog or entered a null string
    zenity --error --text "Operation aborted"
else
    zip $OUTPUT_FILENAME $@ > zip-log
    # Show the user the log file
    zenity --text-info --title "Operation results" \
        --width 500 --height 500 --filename zip-log
    # Clean up temporary files
    rm zip-log
fi

Don't forget to grant the script "zip-files" with exec permissions ... and 
you can access the script by right-clicking in Nautilus 


Le mardi 25 mars 2014 23:42:19 UTC+1, Federico Bruni a écrit :
>
> Which version of Mezzanine are you using? See if this issue helps you:
> https://github.com/stephenmcd/mezzanine/issues/843
>
> I've used the zip import and the images were sorted alphabetically, so I'm 
> surprised to read that it doesn't work for you.
>
> Il giorno martedì 25 marzo 2014 11:43:07 UTC+1, [email protected] ha 
> scritto:
>>
>> Hello,
>>
>> In order to upload several images in one time for gallery, I use a zip 
>> file.
>>
>> And then images are sorted in a reverse alphabetical order (z to a) in 
>> the gallery page.
>> There is away to have them sort in normal order (a to z) ?
>>
>> It seems i can't use filename with diacritic character like : 
>> "Düsseldorf" when importing images in zip file because of an encoding issue 
>> (but works during a single normal upload)
>>
>> 'ascii' codec can't encode character u'\xfc' in position 1: ordinal not in 
>> range(128)
>>
>>
>> Best regards
>>
>>
>>

-- 
You received this message because you are subscribed to the Google Groups 
"Mezzanine Users" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to [email protected].
For more options, visit https://groups.google.com/d/optout.

Reply via email to