protected override void OnShowContextMenu() { GUIDialogMenu dlg = (GUIDialogMenu)GUIWindowManager.GetWindow((int)Window.WINDOW_DIALOG_MENU); if (dlg == null) { return; } dlg.Reset(); dlg.SetHeading(498); // Menu // Dialog items dlg.AddLocalizedString(2168); // Update Exif // Show dialog menu dlg.DoModal(GetID); if (dlg.SelectedId == -1) { return; } switch (dlg.SelectedId) { case 2168: // Update Exif Log.Debug("GUIPicturesExif: Update Exif {0}: {1}", PictureDatabase.UpdatePicture(_currentPicture, -1), _currentPicture); _currentMetaData = PictureDatabase.GetExifFromDB(_currentPicture); SetExifGUIListItems(); Update(); Refresh(); break; } }
protected override void OnPageLoad() { base.OnPageLoad(); if (string.IsNullOrEmpty(_currentPicture) || !File.Exists(_currentPicture)) { ReturnToPreviousWindow(); return; } _currentMetaData = PictureDatabase.GetExifFromDB(_currentPicture); if (_currentMetaData.IsEmpty()) { _currentMetaData = PictureDatabase.GetExifFromFile(_currentPicture); } if (_currentMetaData.IsEmpty()) { ReturnToPreviousWindow(); return; } GUIPropertyManager.SetProperty("#pictures.exif.images.vertical", string.Empty); GUIPropertyManager.SetProperty("#pictures.exif.images.horizontal", string.Empty); SetExifGUIListItems(); Update(); Refresh(); }
private void Update() { if (m_pTexture != null) { m_pTexture.Dispose(); } SetLabel(lblCameraModel, string.Empty); SetLabel(lblDateTakenLabel, string.Empty); SetLabel(lblEquipmentMake, string.Empty); SetLabel(lblExposureCompensation, string.Empty); SetLabel(lblExposureTime, string.Empty); SetLabel(lblFlash, string.Empty); SetLabel(lblFstop, string.Empty); SetLabel(lblImgDimensions, string.Empty); SetLabel(lblImgTitle, string.Empty); SetLabel(lblMeteringMode, string.Empty); SetLabel(lblResolutions, string.Empty); SetLabel(lblShutterSpeed, string.Empty); SetLabel(lblViewComments, string.Empty); if (!File.Exists(FileName)) { GUIPropertyManager.SetProperty("#selectedthumb", string.Empty); return; } int iRotate = PictureDatabase.GetRotation(FileName); m_pTexture = Util.Picture.Load(FileName, iRotate, (int)Thumbs.LargeThumbSize.uhd, (int)Thumbs.LargeThumbSize.uhd, true, false, out m_iTextureWidth, out m_iTextureHeight); ExifMetadata.Metadata metaData = PictureDatabase.GetExifFromDB(FileName); if (metaData.IsEmpty()) { metaData = PictureDatabase.GetExifFromFile(FileName); } if (!metaData.IsEmpty()) { SetLabel(lblCameraModel, metaData.CameraModel.DisplayValue); SetLabel(lblDateTakenLabel, metaData.DatePictureTaken.DisplayValue); SetLabel(lblEquipmentMake, metaData.EquipmentMake.DisplayValue); SetLabel(lblExposureCompensation, metaData.ExposureCompensation.DisplayValue); SetLabel(lblExposureTime, metaData.ExposureTime.DisplayValue); SetLabel(lblFlash, metaData.Flash.DisplayValue, true); SetLabel(lblFstop, metaData.Fstop.DisplayValue); SetLabel(lblImgDimensions, metaData.ImageDimensionsAsString()); SetLabel(lblImgTitle, Path.GetFileNameWithoutExtension(FileName)); SetLabel(lblMeteringMode, metaData.MeteringMode.DisplayValue, true); SetLabel(lblResolutions, metaData.ResolutionAsString()); SetLabel(lblShutterSpeed, metaData.ShutterSpeed.DisplayValue); SetLabel(lblViewComments, metaData.ViewerComments.DisplayValue); imgPicture.IsVisible = false; } metaData.SetExifProperties(); GUIPropertyManager.SetProperty("#selectedthumb", FileName); }