2019-11-29 01:11:05 +01:00
|
|
|
h1 Reverse Search
|
|
|
|
|
2024-07-19 15:29:02 +02:00
|
|
|
= form_for @changeset, ~p"/search/reverse", [multipart: true, as: :image], fn f ->
|
2024-08-26 05:50:33 +02:00
|
|
|
.walloftext
|
|
|
|
p
|
|
|
|
' Basic image similarity search. Finds uploaded images similar to the one
|
|
|
|
' provided based on simple intensities and uses the median frame of
|
|
|
|
' animations; very low contrast images (such as sketches) will produce
|
|
|
|
' poor results and, regardless of contrast, results may include seemingly
|
|
|
|
' random images that look very different.
|
2019-11-29 01:11:05 +01:00
|
|
|
|
|
|
|
.image-other
|
|
|
|
#js-image-upload-previews
|
|
|
|
p Upload a file from your computer, or provide a link to the page containing the image and click Fetch.
|
|
|
|
.field
|
|
|
|
= file_input f, :image, class: "input js-scraper"
|
2024-07-22 03:54:01 +02:00
|
|
|
= error_tag f, :uploaded_image
|
2024-07-19 15:29:02 +02:00
|
|
|
= error_tag f, :image_width
|
|
|
|
= error_tag f, :image_height
|
|
|
|
= error_tag f, :image_mime_type
|
2019-11-29 01:11:05 +01:00
|
|
|
|
|
|
|
.field.field--inline
|
2020-01-11 19:50:53 +01:00
|
|
|
= url_input f, :url, name: "url", class: "input input--wide js-scraper", placeholder: "Link a deviantART page, a Tumblr post, or the image directly"
|
2020-04-19 02:14:40 +02:00
|
|
|
button.button.button--separate-left#js-scraper-preview(type="button" title="Fetch the image at the specified URL" data-disable-with="Fetch" disabled)
|
2019-11-29 01:11:05 +01:00
|
|
|
' Fetch
|
|
|
|
|
|
|
|
.field-error-js.hidden.js-scraper
|
|
|
|
|
|
|
|
h4 Optional settings
|
|
|
|
|
|
|
|
.field
|
|
|
|
= label f, :distance, "Match distance (suggested values: between 0.2 and 0.5)"
|
|
|
|
br
|
2024-07-19 15:29:02 +02:00
|
|
|
= number_input f, :distance, min: 0, max: 1, step: 0.01, class: "input"
|
|
|
|
= error_tag f, :distance
|
2019-11-29 01:11:05 +01:00
|
|
|
|
2024-07-19 15:29:02 +02:00
|
|
|
= error_tag f, :limit
|
2019-11-29 01:11:05 +01:00
|
|
|
|
|
|
|
.field
|
|
|
|
= submit "Reverse Search", class: "button"
|
|
|
|
|
|
|
|
= cond do
|
|
|
|
- is_nil(@images) ->
|
2024-08-26 05:50:33 +02:00
|
|
|
/ Don't render anything.
|
2023-11-23 17:07:49 +01:00
|
|
|
|
2019-11-29 01:11:05 +01:00
|
|
|
- Enum.any?(@images) ->
|
2024-08-26 05:50:33 +02:00
|
|
|
.block#imagelist-container
|
|
|
|
section.block__header.page__header.flex
|
|
|
|
span.block__header__title.page__title.hide-mobile
|
|
|
|
' Search by uploaded image
|
2019-11-29 01:11:05 +01:00
|
|
|
|
|
|
|
table
|
|
|
|
tr
|
|
|
|
th
|
|
|
|
th Image
|
|
|
|
th
|
2023-11-23 17:07:49 +01:00
|
|
|
|
2019-11-29 01:11:05 +01:00
|
|
|
= for match <- @images do
|
|
|
|
tr
|
2019-11-29 01:34:22 +01:00
|
|
|
th
|
2024-06-06 22:28:35 +02:00
|
|
|
h3 = link "##{match.id}", to: ~p"/images/#{match}"
|
2019-11-29 01:11:05 +01:00
|
|
|
p
|
2023-05-29 13:06:41 +02:00
|
|
|
= if image_has_sources(match) do
|
2019-11-29 01:11:05 +01:00
|
|
|
span.source_url
|
2023-05-29 13:06:41 +02:00
|
|
|
= link "Source", to: image_first_source(match)
|
2019-11-29 01:11:05 +01:00
|
|
|
- else
|
|
|
|
' Unknown source
|
|
|
|
|
2024-09-30 23:10:55 +02:00
|
|
|
.block__content
|
2024-08-26 05:50:33 +02:00
|
|
|
= for image <- @images do
|
|
|
|
= render PhilomenaWeb.ImageView, "_image_box.html", image: image, link: ~p"/images/#{image}", size: :thumb, conn: @conn
|
2019-11-29 01:11:05 +01:00
|
|
|
|
2024-08-26 05:50:33 +02:00
|
|
|
.block__header.block__header--light.page__header.flex
|
|
|
|
span.block__header__title.page__info
|
|
|
|
= render PhilomenaWeb.PaginationView, "_pagination_info.html", page: @images
|
2019-11-29 01:11:05 +01:00
|
|
|
|
2024-08-26 05:50:33 +02:00
|
|
|
.flex__right.page__options
|
|
|
|
a href="/settings/edit" title="Display Settings"
|
|
|
|
i.fa.fa-cog
|
|
|
|
span.hide-mobile.hide-limited-desktop<>
|
|
|
|
' Display Settings
|
2019-11-29 01:11:05 +01:00
|
|
|
|
|
|
|
- true ->
|
|
|
|
p
|
2024-08-26 05:50:33 +02:00
|
|
|
' No images found!
|