Skip to content

Commit 5d0c659

Browse files
committed
Do not attempt to encode binary image data as JSON
1 parent 6dfef4e commit 5d0c659

File tree

1 file changed

+3
-3
lines changed

1 file changed

+3
-3
lines changed

publication/lib/field_publication_web/iiif_helper.ex

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -4,13 +4,13 @@ defmodule FieldPublicationWeb.IIIFHelper do
44
URI.decode(identifier)
55
|> String.split("/")
66

7-
"#{FieldPublication.FileService.get_raw_image_data_path(project)}/#{uuid}"
7+
"#{FieldPublication.FileService.get_raw_image_data_path(project)}/ptif/#{uuid}"
88
end
99

1010
def handle_404(conn, plug_info) do
1111
response_body =
1212
if Plug.Conn.request_url(conn) |> String.ends_with?(".json") do
13-
plug_info
13+
Jason.encode!(plug_info)
1414
else
1515
File.read!(
1616
Application.app_dir(:field_publication, "priv/static/images/image_not_found.png")
@@ -20,7 +20,7 @@ defmodule FieldPublicationWeb.IIIFHelper do
2020
Plug.Conn.resp(
2121
conn,
2222
404,
23-
Jason.encode!(response_body)
23+
response_body
2424
)
2525
end
2626
end

0 commit comments

Comments
 (0)