-
Notifications
You must be signed in to change notification settings - Fork 325
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
show clipped paper snapshot in fix metadata dialog #4645
base: master
Are you sure you want to change the base?
Conversation
Build successful. Some useful links:
This preview will be removed when the branch is merged. |
This is a nice idea. Comments:
Even I was confused at what appeared to be a random name string at the bottom. I think some kind of colored box or well with a label should be displayed to demonstrate that this is the read-only, newly-rendered name string, and that the image displayed is for verification purposes and comes from the paper. |
Hmm, looking a lot better, but
|
Checked on mobile: the snapshot gets cut off on the right, but clicking on it or clicking the PDF link is a workaround. I guess another option is to make it horizontally scrollable (not sure how). |
Ideally it would just scale to the enclosing div width. I bet @mbollmann knows how to make that happen. |
The problem I'm running into is how to crop the image based on its full resolution and then resize the image to fill the space. The cropping techniques I am trying (to remove the top 50px of the image) are computing 50px of the resized image. I guess I could crop as a percentage but only if all the snapshots are the same height. I think the other issues are fixed. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Unrelated (?) to this change, when I preview this in Firefox’s responsive design mode, the name boxes look like this even for relatively large displays — below is an emulated iPad display:
Hadn’t we fixed this at some point to reduce margins and the width of these boxes on smaller displays, or am I hallucinating that?
hugo/layouts/papers/single.html
Outdated
<div style="height: 150px; text-align: center; overflow: hidden; position: relative;"> | ||
<a id="paperSnapshot" href=""><img id="paperSnapshotImg" src="" style="position: absolute; left: 0; top: -50px;"></a> | ||
</div> |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I played around with this a bit and think something like this might work:
<div style="max-height:150px;" class="overflow-hidden w-100">
<a id="paperSnapshot" href="https://aclanthology.org/thumb/2024.tacl-1.3.jpg">
<img id="paperSnapshotImg" src="https://aclanthology.org/thumb/2024.tacl-1.3.jpg" class="w-100" style="transform: translate(0, 5%) scale(1.25);">
</a>
</div>
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I played quite a bit but eventually had too many hours into the project and was happy to have something working. This kind of design isn't my forte. I'll try pushing up this change on this PR.
we could add another CGI script to generate a better cropped JPEG on the fly. Come to think of it, it might be worth changing the thumb thumbnails to work the same way. |
I can think of 3 options:
|
If we do it on the server, we can probably just use ImageMagick. I tried running |
@mjpost How easy would it be to run ImageMagick on the server as suggested above? I think that would solve the scaling issues. |
Easy. Do you think this is better than just generating them on the fly? Or maybe it's orthogonal?
|
"On the fly" = generating thumbnails on demand? I don't know how easy that would be to implement. I was thinking that the margin-trimmed thumbnails could simply replace the current thumbnails. |
Which looks better—width always at 100%, or max-width of 100%? For https://preview.aclanthology.org/dialog-snapshot/2020.semeval-1.100/, the former cuts off the last author row on desktop, and is also more pixelated. |
It seems better to have all the info there, but I like the centered look better |
I like (c). Do you want me to generate higher-res icons for the preview? I did smaller ones for the thumbnails, but it would make sense to have higher-res ones here. The command used to build the thumbnails is: convert $file -background white -flatten -resize x600^ -gravity North -crop 600x600+0+10 -colorspace Gray $outfile I then run |
Higher-res is worth a try. Then we could do |
Okay trying 1024. 2021.lchange-1.8 should be working. Let me know if you want higher. |
https://preview.aclanthology.org/dialog-snapshot/2021.lchange-1.8/ - the resolution looks good but the trimming is now wrong. If it was fixed at 50px then that has to be scaled to match the new resolution I guess. |
Hmm. It's higher-res but not trimmed at all. Does this look better? https://aclanthology.org/thumb/2021.lchange-1.8-trimmed.jpg This was produced with |
Re: #4604 This PR extends the paper metadata "Fix data" dialog to show the snapshot of the title/author block followed by a string list of all the edited author names, so the user can easily check if they match. There is a link to the PDF in case the snapshot is missing/insufficient.