Skip to content

Commit

Permalink
Use sharp stats instead of metadata to test image files
Browse files Browse the repository at this point in the history
  • Loading branch information
nathanielrindlaub committed Sep 7, 2023
1 parent e7e6c96 commit 601d3cc
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions ingest-image/task.js
Original file line number Diff line number Diff line change
Expand Up @@ -121,16 +121,16 @@ export default class Task {
md = await this.enrich_meta_data(md, exif_data, mimetype);

try {
await this.sharp_meta(md);
await this.sharp_stats(md);
} catch (err) {
md.errors.push('Sharp could not open provided image');
}

await this.save_image(md);
}

async sharp_meta(md) {
return await sharp(path.join(this.tmp_dir, md.FileName)).metadata();
async sharp_stats(md) {
return await sharp(path.join(this.tmp_dir, md.FileName)).stats();
}

async save_image(md) {
Expand Down

0 comments on commit 601d3cc

Please sign in to comment.