![]() ![]() Parse.add_argument("-t", "-fit", default=False, type=str_to_bool, help="shrink to fit screen i.e. Parse.add_argument( "-text_width", default=90, type=int, help="number of character before breaking into new line") parse.add_argument( "-show_text", default="date folder location", help="show text, include combination of words: name, date, location") +parse.add_argument( "-show_text", default="name date folder location usercomment", help="show text, include combination of words: name, date, location") Parse.add_argument( "-show_text_sz", default=40, type=int, help="text character size") Parse.add_argument( "-show_text_fm", default="%b %d, %Y", help="format to show date over the image") Parse.add_argument("-s", "-show_text_tm", default=6.0, type=float, help="time to show text over the image") # NB the reason that absolute paths are used here is because relative ones can -55,7 +57,7 parse.add_argument("-r", "-reshuffle_num", default=1, type=int, help="times thr + if "usercomment" in txt: + show_text |= 16 + if (config.SHOW_TEXT & 16) = 16: # usercomment + info_strings.append(sanitize_string(er_comment))ĭiff -git a/PictureFrame2020config.py b/PictureFrame2020config.py Info_strings.append(sanitize_string(os.path.basename(os.path.dirname(iFiles.fname)))) Import PictureFrame2020geo as -344,6 +354,7 if config.USE_MQTT:Ĭlient.subscribe("text_off".format(id): + if ExifTags.TAGS = 'UserComment': + EXIF_USERCOMMENT = k return (orientation, dt, fdt, location, aspect) + return (orientation, dt, fdt, location, aspect, user_comment)ĭef -307,11 +314,14 def convert_heif(fname):ĮXIF_DATID = None # this needs to be set before get_files() above can extract exif date info Location = geo.get_location(exif_data)Įxcept Exception as e: # NB should really check error here but it's almost certainly due to lack of exif dataįdt = time.strftime(config.SHOW_TEXT_FM, time.localtime(dt)) If config.LOAD_GEOLOC and geo.EXIF_GPSINFO in exif_data: + if EXIF_USERCOMMENT in exif_data: + user_comment = exif_data Orientation = int(exif_data)Īspect = 1.0 / aspect # image rotated 270 or 90 degrees ![]() Im = Image.open(file_path_name) # lazy operation so shouldn't load (better test -285,13 +290,15 def get_exif_info(file_path_name, im=None): Temp_list_first = -273,6 +277,7 def get_exif_info(file_path_name, im=None):Īspect = 1.5 # assume landscape aspect until we determine otherwise If -255,7 +258,8 def get_files(dt_from=None, dt_to=None):įile_list.sort(key=lambda x: x.mtime) # will be later files last Self.shown_with = None # set to pic_num of image this was paired -144,12 +145,13 def tex_load(pic_num, iFiles, size=None): def _init_(self, fname, orientation=1, mtime=None, dt=None, fdt=None, location="", aspect=1.5): + def _init_(self, fname, orientation=1, mtime=None, dt=None, fdt=None, location="", aspect=1.5, user_comment=""): a/PictureFrame2020.py +++ b/PictureFrame2020.py -27,7 +27,7 from PIL import Image, ExifTags, ImageFilter # these are needed for getting exif I take it, however, that the issues that you highlighted would still apply, although all the links you mentioned all point to 'picframe' and not 'pi3d_demos'ĭiff -git a/PictureFrame2020.py b/PictureFrame2020.py ![]() ![]() I wondered, therefore, in the same way that PictureFrame2020geo.py retrieves the Exif GPS data, whether the 'UserComment' data could be retrieved similarly. As I said, I have found a successful method to do this using ExifTool. My thought was to embed the original folder name in the image metadata and the exif 'UserComment' field seemed a reasonable option (although, I assume that any Ascii type Exif tag would work as well). The images on the pi for the picture frame are in folders based on common keywords and contain images from multiple PC folders. For images without GPS data then that name would be adequate for my purposes. My photos are stored in folders on the PC named by approximate location and date, for example 'Tenerife 2008', 'Malta 2011' and so on. For images that have GPS data then that is working fine, but many of my images do not have GPS data so, at the moment, I have to display the date of the image and then go back to my PC (where the originals are stored) and look up the location for that date. However, if, as I assume, that means the folder on the pi containing the images, then that would not achieve what I am looking for.īasically I am looking to display the location of the image. Obviously I can update the application (which is probably a good idea anyway). I am clearly using an earlier version of PictureFrame2020config.py as my 'show_text' line does not include 'folder'. ![]()
0 Comments
Leave a Reply. |
AuthorWrite something about yourself. No need to be fancy, just an overview. ArchivesCategories |