لدي مجموعة صور كبيرة مع الكثير من الفوقية التي كنت أرغب في كودي الشرائح شاشة لعرضه. مع الكثير القراءة, تجارب, والتجربة والخطأ, لقد حصلت أخيرا نظام معقول أن يظهر ما كنت أمل.
The main file for the slideshow screensaver is located (on windows) في المستخدمين ٪ المستخدم٪ APPDATA التجوال كودي الإضافات screensaver.picture.slideshow الموارد ليب ويسمى gui.py
If you know some python you can make all kinds of modifications to this file. Below are what I made to show information about the author, camera, and where and when the picture was taken. I get the location from the folder name as I keep all my photos in a folder with an 8‑character date at the start (YY-MM-DD) followed by the place or event name.
بعد خط 163, added the following null values for camera and author
camera = 'unknown camera'
artist = 'unknown'
بعد خط 173, added the following to get the camera and author from exif
إذا exiftags.has_key('Image Model'): كاميرا = شارع(exiftags['Image Model']).فك تشفير('utf-8') إذا exiftags.has_key('Image Artist'): الفنان = شارع(exiftags['Image Artist']).فك تشفير('utf-8')
خط متغير 183 to start the process or reformatting the date
الوقت = التاريخ والوقت{10:].انشق، مزق(':')
خط استبدال 187 to create a better formatted date
إذا كان تاريخ[1] == '01': تاريخ[1] = 'Jan' elif date[1] == '02': تاريخ[1] = 'Feb' elif date[1] == '03': تاريخ[1] = 'Mar' elif date[1] == '04': تاريخ[1] = 'Apr' elif date[1] == '05': تاريخ[1] = 'May' elif date[1] == '06': تاريخ[1] = 'Jun' elif date[1] == '07': تاريخ[1] = 'Jul' elif date[1] == '08': تاريخ[1] = 'Aug' elif date[1] == '09': تاريخ[1] = 'Sept' elif date[1] == '10': تاريخ[1] = 'Oct' elif date[1] == '11': تاريخ[1] = 'Nov' elif date[1] == '12': تاريخ[1] = 'Dec' datetime = date[2] + '-' + تاريخ[1] + '-' + تاريخ[0] + ' at' + زمن[0] + ':' + زمن[1]
خط استبدال 228 to output the new data
جذر, FOLDER = os.path.split(os.path.dirname(IMG[0])) galname = FOLDER if (galname or 'x')[1].isdigit(): galname = FOLDER[9:] self.datelabel.setLabel(ختم نهاية + '. Taken with ' + الة تصوير + ' on ' + التاريخ والوقت + '. (ج) ' + فنان + '.')
“Hi James I realise it has been a long while, but I just checked this on windows 11 (build 23H2)…”