Pour info, exporter la photo originale conserve la date de création comme date du fichier.trop de photos ... à la même date d'exportation et non à date de création
Pour info, exporter la photo originale conserve la date de création comme date du fichier.trop de photos ... à la même date d'exportation et non à date de création
Pour info, exporter la photo originale conserve la date de création comme date du fichier.
Et bien sur mon Mac la date initiale est conservée, je viens de refaire un test :Ben non, c'est le sujet de cette discussion.
Regarde mon post #1 : la date de création et de modification sont celles du jour (sur MBA M1)
Regarde mon post #6 : la date de modification est celle de prise de la photo (sur Mac Intel en MacOS 10.13.6)



Alors c'est encore plus curieux, mais la date du fichier exporté (par export original) n'est pas toujours la date de prise de vue, c'est en fait souvent une date décalée de plusieurs mois, mais sans que j'en comprenne la logique...C'est marrant, je n'ai pas le meme comportement que toi sur mon Mac...
---- File ----
File Name                       : 20220724_121700.jpg
Directory                       : /Users/xxxxxxx/Desktop/PHOTO chez xxxxx Juillet 2022
File Size                       : 1132 kB
File Modification Date/Time     : 2022:07:24 12:17:00+02:00
File Access Date/Time           : 2022:08:27 14:16:49+02:00
File Inode Change Date/Time     : 2022:08:13 10:24:41+02:00
File Permissions                : -rwxrwxrwx
File Type                       : JPEG
File Type Extension             : jpg
MIME Type                       : image/jpeg
Exif Byte Order                 : Little-endian (Intel, II)
Image Width                     : 4000
Image Height                    : 2250
Encoding Process                : Baseline DCT, Huffman coding
Bits Per Sample                 : 8
Color Components                : 3
Y Cb Cr Sub Sampling            : YCbCr4:2:0 (2 2)---- EXIF ----
Make                            : samsung
Camera Model Name               : SM-A127F
Orientation                     : Horizontal (normal)
X Resolution                    : 72
Y Resolution                    : 72
Resolution Unit                 : inches
Software                        : A127FXXS5AVE1
Modify Date                     : 2022:07:24 12:16:59
Y Cb Cr Positioning             : Centered
Exposure Time                   : 1/33
F Number                        : 2.0
Exposure Program                : Program AE
ISO                             : 320
Exif Version                    : 0220
Date/Time Original              : 2022:07:24 12:16:59
Create Date                     : 2022:07:24 12:16:59
Offset Time                     : +02:00
Offset Time Original            : +02:00
Shutter Speed Value             : 1
Aperture Value                  : 2.0
Exposure Compensation           : 0
Max Aperture Value              : 2.0
Metering Mode                   : Center-weighted average
Flash                           : No Flash
Focal Length                    : 4.6 mm
Color Space                     : sRGB
Exif Image Width                : 4000
Exif Image Height               : 2250
Exposure Mode                   : Auto
White Balance                   : Auto
Digital Zoom Ratio              : 2.83
Focal Length In 35mm Format     : 25 mm
Scene Capture Type              : Standard
Image Unique ID                 : H48LLNIR0AM
Compression                     : JPEG (old-style)
Thumbnail Offset                : 794
Thumbnail Length                : 59213
Thumbnail Image                 : (Binary data 59213 bytes, use -b option to extract)
---- MakerNotes ----
Time Stamp                      : 2022:07:24 12:17:00+02:00
---- Composite ----
Aperture                        : 2.0
Image Size                      : 4000x2250
Megapixels                      : 9.0
Scale Factor To 35 mm Equivalent: 5.4
Shutter Speed                   : 1/33
Date/Time Original              : 2022:07:24 12:16:59+02:00
Modify Date                     : 2022:07:24 12:16:59+02:00
Circle Of Confusion             : 0.006 mm
Field Of View                   : 71.5 deg
Focal Length                    : 4.6 mm (35 mm equivalent: 25.0 mm)
Hyperfocal Distance             : 1.91 m
Light Value                     : 5.4-- remplace date du fichier par la date exif creation
tell application "Finder"
    set Chemin to choose folder with prompt "Sélectionnez le dossier contenant les fichiers à redater"
    my inspecter(Chemin)
end tell
on inspecter(un_dossier)
    tell application "Finder"
        -- traitement des fichiers :
        set les_fichiers to files of un_dossier
        repeat with chaque_fichier in les_fichiers
            -- traitement d'un fichier
            
            set lefichier to chaque_fichier
            set AppleScript's text item delimiters to {""}
            set nom to name of chaque_fichier --récupère le nom du fichier
            set extens to document file nom in un_dossier --recupere l extension du fichier
            set lextension to name extension of extens
            set sauv to AppleScript's text item delimiters --sauvegarder la variable delimiteur
            set AppleScript's text item delimiters to {"."} --récupère la partie avant le dernier "."
            set elements to text items of nom
            set nomcourt to (items 1 thru -2 of elements) as string
            set ancien_nom to nomcourt
            set AppleScript's text item delimiters to sauv --restaurer la variable delimiteur
            
            set chaque_fichier to chaque_fichier as string
            
            try
                set datephoto to do shell script "/usr/local/bin/exiftool -DateTimeOriginal " & quoted form of POSIX path of chaque_fichier
                if datephoto is "" then set datephoto to do shell script "/usr/local/bin/exiftool -CreationDate " & quoted form of POSIX path of chaque_fichier
                if datephoto is "" then set datephoto to do shell script "/usr/local/bin/exiftool -CreateDate " & quoted form of POSIX path of chaque_fichier
                
                
            on error
                -- Ecrit un fichier erreur sur le bureau si erreur chargement date
                set lelog to open for access ((path to desktop folder as text) & "les erreurs.txt") as text with write permission
                write "Le fichier ne contient pas de date  : " & chaque_fichier & return to lelog starting at eof
                close access lelog
                
                set datephoto to ""
            end try
            
            if length of datephoto > 20 then
                set x to (length of datephoto) - 33
                set DateOriginale to text -x thru -1 of datephoto
                set ladate to text 1 thru 5 of DateOriginale
                set lannee to ladate
                set ladate to ladate & text 7 thru 8 of DateOriginale
                set lemois to text 7 thru 8 of DateOriginale
                set ladate to ladate & text 10 thru 11 of DateOriginale
                set lejour to text 10 thru 11 of DateOriginale
                set ladate to ladate & text 13 thru 14 of DateOriginale
                set lheure to text 13 thru 14 of DateOriginale
                set ladate to ladate & text 16 thru 17 of DateOriginale
                set lesminutes to text 16 thru 17 of DateOriginale
                set ladate to ladate & "." & text 19 thru 20 of DateOriginale
                set lessecondes to text 19 thru 20 of DateOriginale
                set newnom to lannee & "-" & lemois & "-" & lejour & " " & lheure & "." & lesminutes & "." & lessecondes
                
                set xxx to ladate as string
                
                if xxx is " 000000000000.00" then
                    -- Ecrit un fichier erreur sur le bureau si erreur chargement date(=0000...)
                    set lelog to open for access ((path to desktop folder as text) & "les erreurs.txt") as text with write permission
                    write "Le fichier ne contient pas de date : " & chaque_fichier & return to lelog starting at eof
                    close access lelog
                else
                    do shell script "touch -t " & ladate & " " & quoted form of POSIX path of chaque_fichier
                end if
            end if
            
            if datephoto is not "" then
                
            else
                set lelog to open for access ((path to desktop folder as text) & "les erreurs.txt") as text with write permission
                write "Le fichier ne contient pas de date  : " & chaque_fichier & return to lelog starting at eof
                close access lelog
            end if
            
        end repeat
        
        -- traitement des dossiers :
        set les_dossiers to folders of un_dossier
        repeat with chaque_dossier in les_dossiers
            -- traitement d'un dossier
            my inspecter(chaque_dossier)
        end repeat
    end tell
    
end inspecter
tell application "Finder"
    (display dialog ("waouou ... Ca y est c'est fait !") buttons {"Salut !"})
end tell exiftool -gFichier 2:---- ExifTool ----
ExifTool Version Number : 12.54
---- File ----
File Name : 7c62fd58-7945-4171-a3ca-0c5bc35e078b.jpg
Directory : /Users/koala/kDrive/Mes photos/Sans date
File Size : 343 kB
File Modification Date/Time : 2023:01:08 23:52:03+01:00
File Access Date/Time : 2023:01:10 06:59:33+01:00
File Inode Change Date/Time : 2023:01:10 06:54:41+01:00
File Permissions : -rw-------
File Type : JPEG
File Type Extension : jpg
MIME Type : image/jpeg
Image Width : 2048
Image Height : 1536
Encoding Process : Progressive DCT, Huffman coding
Bits Per Sample : 8
Color Components : 3
Y Cb Cr Sub Sampling : YCbCr4:2:0 (2 2)
---- JFIF ----
JFIF Version : 1.01
Resolution Unit : None
X Resolution : 1
Y Resolution : 1
---- Composite ----
Image Size : 2048x1536
Megapixels : 3.1
---- ExifTool ----
ExifTool Version Number : 12.54
---- File ----
File Name : IMG_6332.JPG
Directory : /Users/koala/kDrive/Mes photos/Sans date
File Size : 511 kB
File Modification Date/Time : 2023:01:08 21:36:39+01:00
File Access Date/Time : 2023:01:10 06:57:55+01:00
File Inode Change Date/Time : 2023:01:10 06:53:37+01:00
File Permissions : -rw-------
File Type : JPEG
File Type Extension : jpg
MIME Type : image/jpeg
Exif Byte Order : Big-endian (Motorola, MM)
Current IPTC Digest : d41d8cd98f00b204e9800998ecf8427e
Image Width : 1200
Image Height : 1600
Encoding Process : Baseline DCT, Huffman coding
Bits Per Sample : 8
Color Components : 3
Y Cb Cr Sub Sampling : YCbCr4:2:0 (2 2)
---- JFIF ----
JFIF Version : 1.01
---- EXIF ----
Orientation : Horizontal (normal)
X Resolution : 72
Y Resolution : 72
Resolution Unit : inches
Y Cb Cr Positioning : Centered
Exif Version : 0221
Components Configuration : Y, Cb, Cr, -
Flashpix Version : 0100
Color Space : sRGB
Exif Image Width : 1200
Exif Image Height : 1600
Scene Capture Type : Standard
Compression : JPEG (old-style)
Thumbnail Offset : 316
Thumbnail Length : 11909
Thumbnail Image : (Binary data 11909 bytes, use -b option to extract)
---- Photoshop ----
IPTC Digest : d41d8cd98f00b204e9800998ecf8427e
---- Composite ----
Image Size : 1200x1600
Megapixels : 1.9
Il y en a quand même 1500 mais sur le nombre ça va. Merci encore 1000x pour ton aide.Bonjour,
Malheureusement, on ne voie aucune date de prise de vue de ces photos, donc pas de possibilité en automatique.
Si tu n'as pas beaucoup de photos dans ce cas et que tu connais leurs dates de prise de vue, je peux te faire un petit script qui te permettra de les renseigner manuellement.
 
	