Commit Graph

15 Commits

Author SHA1 Message Date
evazion
4074cc99f9 uploads: fix incorrect remote sizes on pixiv uploads.
Bug: the uploads page showed a remote size of 146 bytes for Pixiv uploads.

Cause: we didn't spoof the Referer header when making the HEAD request
for the image, causing Pixiv to return a 403 error.

Also fix the case where the Content-Length header is absent.
2020-06-24 03:02:45 -05:00
evazion
da235cec05 uploads: fix preview image resizing.
* Fix preview images not being resized to fit the screen when using the
  bookmarklet.

* Fit images to both screen width and height by default. Previously we
  fit to screen width only, so tall images were hard to see.

* Allow clicking on the image or pressing Z to toggle image size.

* Move size information to above the image and add resize links:
** small: fit width and height
** large: fit width
** full: fit none

* Bind the image error handler in an onerror attribute on the image
  itself so that it will always fire. Before it wouldn't fire if the image
  failed immediately on pageload before we could bind the error handler.
2020-03-27 21:16:46 -05:00
evazion
1518c7aad6 /uploads: set referrerpolicy=no-referrer on hotlinked previews.
Don't send the referer when hotlinking preview images on the
/uploads/new page. Improves user privacy and may bypass anti-hotlinking
protections in some cases.
2019-10-07 13:44:35 -05:00
Albert Yi
a57d4a9558 fixes #2680 2018-11-12 16:29:44 -08:00
evazion
6a7cd6ce8e Fix #3984: Twitter: undefined method `first' for nil:NilClass.
Fix Sources::Strategies::Twitter#image_urls to return an empty array
instead of nil when the tweet doesn't contain any images.
2018-11-11 17:41:32 -06:00
evazion
950fcdb7b2 uploads: add new source:<url> dupe check (fix #3873)
* On the /uploads/new page, instead of just showing a "This post has
probably already been uploaded" message, show the actual thumbnails of
posts having the same source as what the user is trying to upload.

* Move the iqdb results section up top, beside the related posts section.
2018-09-06 20:43:20 -05:00
Albert Yi
762dc3da24 Refactor sources 2018-08-24 12:10:51 -07:00
r888888888
c4b5998e64 fixes #2692: Rework bookmarklet preview 2017-03-21 15:41:20 -07:00
Toks
0a5f1b53ba #2426 refactor to use predetermined referer 2015-07-05 11:02:01 -04:00
Toks
b1b31d7387 fixes #2426 2015-07-04 16:31:34 -04:00
r888888888
86b3cfa44b iqdb similar queries now show file size 2015-02-22 11:41:40 -08:00
r888888888
f12fb40e3e implements #2350 2015-02-20 20:04:23 -08:00
Toks
cc3c6d989f Upload preview: use normalized image url
This means that the preview will work even when the user doesn't use the
direct image link. e.g. The user can use the bookmarklet on Pixiv
mode=medium pages.
2014-04-28 15:29:31 -04:00
albert
33954dccbe implemented tinami sources 2011-09-28 18:06:35 -04:00
albert
284141aace refactored source code, work on pixiv integration 2011-09-26 16:47:22 -04:00