diff --git a/Damselfly.Core/Services/ImageRecognitionService.cs b/Damselfly.Core/Services/ImageRecognitionService.cs index 1e49c5b2..ea1d7c02 100644 --- a/Damselfly.Core/Services/ImageRecognitionService.cs +++ b/Damselfly.Core/Services/ImageRecognitionService.cs @@ -181,8 +181,7 @@ public async Task> GetPendingJobs(int maxJobs) // Only pull out images where the metadata has already been scanned, // and the AI hasn't been processed. var images = await db.ImageMetaData.Where(x => x.LastUpdated >= x.Image.LastUpdated - && x.AILastUpdated == null - && x.Width > 0 && x.Height > 0) + && x.AILastUpdated == null ) .OrderByDescending(x => x.LastUpdated) .Take(maxJobs) .Select(x => x.ImageId) @@ -380,6 +379,12 @@ private async Task DetectObjects(ImageMetaData metadata) if ( !fileName.Exists ) return; + if( metadata.Width == 0 || metadata.Height == 0 ) + { + _logger.LogWarning($"Skipping AI detection for image {image.FullPath} - dimensions metadata was zero!!"); + return; + } + try { var thumbSize = ThumbSize.Large; diff --git a/Damselfly.ML.FaceONNX/FaceONNXService.cs b/Damselfly.ML.FaceONNX/FaceONNXService.cs index e39c824a..b259350a 100644 --- a/Damselfly.ML.FaceONNX/FaceONNXService.cs +++ b/Damselfly.ML.FaceONNX/FaceONNXService.cs @@ -137,9 +137,6 @@ public Task> DetectFaces(Image image) List detected = new(); var watch = new Stopwatch("FaceOnnxDetection"); - if( image.Width == 0 || image.Height == 0 ) - return Task.FromResult(detected); - try { var detectedFaces = GetFacesFromImage(image).ToList(); diff --git a/Damselfly.Web.Client/wwwroot/version.js b/Damselfly.Web.Client/wwwroot/version.js index 99f6c9ee..2d8892fb 100644 --- a/Damselfly.Web.Client/wwwroot/version.js +++ b/Damselfly.Web.Client/wwwroot/version.js @@ -1 +1 @@ -const CACHE_VERSION='4.1.0-20240308222015' +const CACHE_VERSION='4.1.0-20240308225414'