Skip to content

Commit

Permalink
Log a warning if also if only original missing, in imageview
Browse files Browse the repository at this point in the history
  • Loading branch information
danielmarreirosdeoliveira committed Jan 16, 2020
1 parent 940584e commit 255417a
Show file tree
Hide file tree
Showing 2 changed files with 22 additions and 8 deletions.
21 changes: 17 additions & 4 deletions app/components/imagegrid/public.ts
Original file line number Diff line number Diff line change
@@ -1,7 +1,20 @@


function _(id: string) {

return 'The filename of the missing image' +
' is \’' + id + '\' (note: no file extension!). ' +
'It should be found in the project folder below the imagestore (see settings page).'
}


export function showMissingImageMessageOnConsole(id: string) {

console.error('Neither original nor thumbnail found for image. ' +
'The filename of the missing image' +
' is \’' + id + '\' (note: no file extension!). ' +
'It should be found in the project folder below the imagestore (see settings page).');
console.error('Neither original nor thumbnail found for image. ' + _(id));
}


export function showMissingOginalImageMessageOnConsole(id: string) {

console.warn('No original found for image. ' + _(id));
}
9 changes: 5 additions & 4 deletions app/components/imageview/image-view.component.ts
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ import {ImageReadDatastore} from '../../core/datastore/field/image-read-datastor
import {M} from '../m';
import {MenuService} from '../../menu-service';
import {ImagesState} from '../imageoverview/view/images-state';
import {showMissingImageMessageOnConsole} from '../imagegrid/public';
import {showMissingImageMessageOnConsole, showMissingOginalImageMessageOnConsole} from '../imagegrid/public';


@Component({
Expand Down Expand Up @@ -246,11 +246,12 @@ export class ImageViewComponent implements OnInit, DoCheck {
private showErrorMessagesForMissingImages() {

this.images
.filter(image => image.thumbSrc === BlobMaker.blackImg)
.filter(image => !this.containsOriginal(image))
.forEach(image => {
const name = image.document && image.document.resource ? image.document.resource.id : 'unknown';
showMissingImageMessageOnConsole(name);
})
if (this.isMissingImage(image)) showMissingImageMessageOnConsole(name);
else showMissingOginalImageMessageOnConsole(name);
});
}


Expand Down

0 comments on commit 255417a

Please sign in to comment.