diff --git a/src/Umbraco.Core/IO/MediaFileSystem.cs b/src/Umbraco.Core/IO/MediaFileSystem.cs index a4305506bb..d843b95709 100644 --- a/src/Umbraco.Core/IO/MediaFileSystem.cs +++ b/src/Umbraco.Core/IO/MediaFileSystem.cs @@ -377,21 +377,28 @@ namespace Umbraco.Core.IO return new Size(width, height); } } + } + catch + { + //We will just swallow, just means we can't read exif data, we don't want to log an error either + } - //we have no choice but to try to read in via GDI + //we have no choice but to try to read in via GDI + try + { using (var image = Image.FromStream(stream)) { - var fileWidth = image.Width; var fileHeight = image.Height; return new Size(fileWidth, fileHeight); } } - catch (Exception) + catch { - //We will just swallow, just means we can't read exif data, we don't want to log an error either - return new Size(Constants.Conventions.Media.DefaultSize, Constants.Conventions.Media.DefaultSize); + //We will just swallow, just means we can't read via GDI, we don't want to log an error either } + + return new Size(Constants.Conventions.Media.DefaultSize, Constants.Conventions.Media.DefaultSize); } #endregion diff --git a/src/Umbraco.Web/Strategies/NotificationsHandler.cs b/src/Umbraco.Web/Strategies/NotificationsHandler.cs index 35f2f382c8..d65f3c6e26 100644 --- a/src/Umbraco.Web/Strategies/NotificationsHandler.cs +++ b/src/Umbraco.Web/Strategies/NotificationsHandler.cs @@ -72,6 +72,34 @@ namespace Umbraco.Web.Strategies content => applicationContext.Services.NotificationService.SendNotification( content, ActionUnPublish.Instance, applicationContext)); + + //Send notifications for the rollback action + ContentService.RolledBack += (sender, args) => applicationContext.Services.NotificationService.SendNotification( + args.Entity, ActionRollback.Instance, applicationContext); + + //Send notifications for the move and restore actions + ContentService.Moved += (sender, args) => + { + // notify about the move for all moved items + foreach(var moveInfo in args.MoveInfoCollection) + { + applicationContext.Services.NotificationService.SendNotification( + moveInfo.Entity, ActionMove.Instance, applicationContext + ); + } + + // for any items being moved from the recycle bin (restored), explicitly notify about that too + foreach(var moveInfo in args.MoveInfoCollection.Where(m => m.OriginalPath.Contains(Constants.System.RecycleBinContentString))) + { + applicationContext.Services.NotificationService.SendNotification( + moveInfo.Entity, ActionRestore.Instance, applicationContext + ); + } + }; + + //Send notifications for the copy action + ContentService.Copied += (sender, args) => applicationContext.Services.NotificationService.SendNotification( + args.Original, ActionCopy.Instance, applicationContext); //Send notifications for the permissions action UserService.UserGroupPermissionsAssigned += (sender, args) => @@ -86,6 +114,5 @@ namespace Umbraco.Web.Strategies } }; } - } }