Skip to content

Commit

Permalink
Merge pull request #3988 from nulib/4767-poster-metadata
Browse files Browse the repository at this point in the history
Add pages metadata to frame extractor
  • Loading branch information
mbklein authored Jun 7, 2024
2 parents 422bed2 + 59b4003 commit eae8ca6
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 2 deletions.
2 changes: 2 additions & 0 deletions app/test/pipeline/actions/generate_poster_image_test.exs
Original file line number Diff line number Diff line change
Expand Up @@ -64,8 +64,10 @@ defmodule Meadow.Pipeline.Actions.GeneratePosterImageTest do
with {:ok, %{headers: headers}} <-
ExAws.S3.head_object(@pyramid_bucket, "posters/#{Pairtree.poster_path(file_set.id)}")
|> ExAws.request() do
assert headers |> Enum.member?({"Content-Type", "image/tiff"})
assert headers |> Enum.member?({"x-amz-meta-width", "1920"})
assert headers |> Enum.member?({"x-amz-meta-height", "1080"})
assert headers |> Enum.member?({"x-amz-meta-pages", "1"})
end

assert(
Expand Down
5 changes: 3 additions & 2 deletions lambdas/frame-extractor/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -189,9 +189,9 @@ const parsePlaylist = async (bucket, key, offset) => {

const uploadToS3 = (data, destination, dimensions) => {
const metadata = {
"Content-Type": "image",
width: dimensions.width.toString(),
height: dimensions.height.toString()
height: dimensions.height.toString(),
pages: "1"
};
return new Promise((resolve, reject) => {
const poster = URI.parse(destination);
Expand All @@ -200,6 +200,7 @@ const uploadToS3 = (data, destination, dimensions) => {
Bucket: poster.host,
Key: getS3Key(poster),
Body: data,
ContentType: "image/tiff",
Metadata: metadata
});
s3Client
Expand Down

0 comments on commit eae8ca6

Please sign in to comment.