Skip to content

Commit

Permalink
Merge branch 'develop' into feature/imageglass-settings
Browse files Browse the repository at this point in the history
  • Loading branch information
d2phap committed Nov 16, 2019
2 parents e6a8d6b + 24750e6 commit 6ce677d
Show file tree
Hide file tree
Showing 4 changed files with 38 additions and 6 deletions.
20 changes: 15 additions & 5 deletions Source/Components/ImageGlass.ImageBox/HighResolutionGifAnimator.cs
Original file line number Diff line number Diff line change
Expand Up @@ -172,11 +172,21 @@ public bool CanAnimate(Image image) {

// image lock should be held
//
private bool ImageHasTimeFrames(Image image) {
foreach (Guid guid in image.FrameDimensionsList) {
FrameDimension dimension = new FrameDimension(guid);
if (dimension.Equals(FrameDimension.Time))
return image.GetFrameCount(FrameDimension.Time) > 1;
private bool ImageHasTimeFrames(Image image)
{
try
{
foreach (Guid guid in image.FrameDimensionsList)
{
if (guid == FrameDimension.Time.Guid)
return image.GetFrameCount(FrameDimension.Time) > 1;
}
}
catch
{
// fire-eggs 20191114 fix observed issue: if pounding heavily CTRL+Space (to
// toggle GIF animation) _while_ playing a slideshow, there is a window of
// time where the image could be invalid. This manifested as an exception here.
}

return false;
Expand Down
1 change: 1 addition & 0 deletions Source/ImageGlass/frmMain.Designer.cs

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 2 additions & 0 deletions Source/ImageGlass/frmMain.cs
Original file line number Diff line number Diff line change
Expand Up @@ -2913,6 +2913,8 @@ private void frmMain_Activated(object sender, EventArgs e)
// Update ZoomLevels
picMain.ZoomLevels = new ImageBoxZoomLevelCollection(Configs.ZoomLevels);

ApplyZoomMode(GlobalSetting.ZoomMode);

#endregion

}
Expand Down
21 changes: 20 additions & 1 deletion Source/ImageGlass/frmSetting.cs
Original file line number Diff line number Diff line change
Expand Up @@ -1086,6 +1086,17 @@ private void RegisterFileAssociations(bool resetFormatList = false)
p.StartInfo.Arguments = $"regassociations {formats}";
p.Start();

try
{
p.Start();
}
catch
{
// Clicking 'Cancel' in the "User Account Control" dialog throws a
// "User cancelled" exception. Just continue quietly in that case.
return;
}

p.WaitForExit();
isError = p.ExitCode != 0;

Expand Down Expand Up @@ -2239,9 +2250,17 @@ private bool ApplySettings()
#endregion



Configs.IsShowingHiddenImages = chkShowHiddenImages.Checked;
Configs.IsLoopBackViewer = chkLoopViewer.Checked;
Configs.IsCenterImage = chkIsCenterImage.Checked;

// IsCenterImage
newBool = chkIsCenterImage.Checked;
if (Configs.IsCenterImage != newBool)
{
Configs.IsCenterImage = newBool;
Local.ForceUpdateActions |= MainFormForceUpdateAction.OTHER_SETTINGS;
}


#region ImageLoadingOrder: MainFormForceUpdateAction.IMAGE_LIST
Expand Down

0 comments on commit 6ce677d

Please sign in to comment.