After an evaluation, GNOME has moved from Bugzilla to GitLab. Learn more about GitLab.
No new issues can be reported in GNOME Bugzilla anymore.
To report an issue in a GNOME project, go to GNOME GitLab.
Do not go to GNOME Gitlab for: Bluefish, Doxygen, GnuCash, GStreamer, java-gnome, LDTP, NetworkManager, Tomboy.
Bug 407128 - Automatic uploading to Image Hoster
Automatic uploading to Image Hoster
Status: RESOLVED OBSOLETE
Product: gnome-screenshot
Classification: Core
Component: general
git master
Other All
: Normal enhancement
: ---
Assigned To: gnome-screenshot-maint
gnome-screenshot-maint
: 340515 539567 636974 705061 (view as bug list)
Depends on:
Blocks:
 
 
Reported: 2007-02-12 17:13 UTC by Jonathan Sieber
Modified: 2020-11-26 15:42 UTC
See Also:
GNOME target: ---
GNOME version: Unversioned Enhancement


Attachments
Patch to upload screenshots to imgur.com (17.86 KB, patch)
2012-02-19 22:30 UTC, Nirbheek Chauhan
none Details | Review
Restrict the preview area size using the screen size rather than the screenshot size (1.30 KB, patch)
2012-02-20 14:53 UTC, Nirbheek Chauhan
none Details | Review
Patch to upload screenshots to imgur.com (25.04 KB, patch)
2012-02-20 17:32 UTC, Nirbheek Chauhan
none Details | Review
Patch to upload screenshots to imgur.com (25.37 KB, patch)
2012-02-28 08:02 UTC, Nirbheek Chauhan
none Details | Review

Description Jonathan Sieber 2007-02-12 17:13:36 UTC
It would be great to have an option to automatically submit the shot to a quick image hoster and give to user the URL to quickly share the image with others.
I'm not sure whether the popular hosters like ImageShack would allow this, but perhaps it is possible to create an own service.
Comment 1 Vincent Untz 2008-07-27 14:41:43 UTC
*** Bug 539567 has been marked as a duplicate of this bug. ***
Comment 2 Vincent Untz 2008-07-27 14:42:15 UTC
Quoting bug 539567:

---
for example, using postr to send to flickr, using f-spot to send to all others
and using ScrnShots API (
http://groups.google.com/group/scrnshots-developer-talk/web/api-documentation )
to send to them.
---
Comment 3 Jakub 'Livio' Rusinek 2008-07-27 18:19:55 UTC
thanks Vincent :) .
Comment 4 Cosimo Cecchi 2011-06-13 19:34:03 UTC
*** Bug 636974 has been marked as a duplicate of this bug. ***
Comment 5 Severo Raz 2012-02-10 02:23:51 UTC
Is this being developed?
Comment 6 Nirbheek Chauhan 2012-02-19 22:27:05 UTC
I wrote a patch that adds an Upload/Pause button + progress bar to upload to imgur.com (they seem to be FOSS-friendly, and provide a simple API). Eventually we should use libsocialweb or something.

I started working on gnome-utils.git/gnome-screenshot because gnome-screenshot.git seems to need gnome-shell-3.3.x to work (or am I missing something?)

Below I'll be attaching a patch against gnome-screenshot.git which is actually a blind port from gnome-utils.git/gnome-screenshot with only a compile test since I can't get gnome-screenshot.git to work with GNOME 3.2

TODO:
* Does not handle HTTP errors (actually, most errors) properly.
* After uploading, the image URL and the image delete URL are opened in the browser. They should probably be just displayed in the window. Need to figure out the exact UI for this.
* The code is a bit of a mess. Too many static variables.
* Translation stuff is probably missing/wrong. Not sure.

For the convenience of people in the CC list, a patch against gnome-utils-3.2.1 can be found here:

http://git.overlays.gentoo.org/gitweb/?p=dev/nirbheek.git;a=blob_plain;f=gnome-extra/gnome-utils/files/gnome-utils-3.2.1-upload-screenshots.patch;hb=HEAD
Comment 7 Nirbheek Chauhan 2012-02-19 22:30:32 UTC
Created attachment 208006 [details] [review]
Patch to upload screenshots to imgur.com

I realize this code is probably fundamentally wrong since it uploads only to imgur, and most likely can't be merged.

Nevertheless, code reviews would be greatly appreciated.
Comment 8 Nirbheek Chauhan 2012-02-20 14:53:23 UTC
Created attachment 208041 [details] [review]
Restrict the preview area size using the screen size rather than the screenshot size

This avoids horizontal resizing and widget jumping when the "Upload" button is pressed.

The patch is completely independent of the other patches.
Comment 9 Nirbheek Chauhan 2012-02-20 17:32:37 UTC
Created attachment 208050 [details] [review]
Patch to upload screenshots to imgur.com

This updated patch displays the image and delete links in the screenshot dialog itself (with GtkLinkButton), instead of unexpectedly opening them in the browser.

Here's a video (~2MB) demonstrating how it looks/works:

http://dev.gentoo.org/~nirbheek/files/gnome3/video/gnome-screenshot-demo.webm

(I haven't attached it to the bug because I'm on mobile broadband right now)
Comment 10 Severo Raz 2012-02-20 22:15:27 UTC
Its amazing! In my opinion imgur is a great service, but perhaps - as you said - it would be a good idea to be able to upload to other services with the mentioned API before the patch is applied to the main repository.

Great work! If only there was someone like you for every bug report
Comment 11 Nirbheek Chauhan 2012-02-28 08:02:15 UTC
Created attachment 208552 [details] [review]
Patch to upload screenshots to imgur.com

This updated patch removes one static variable, and replaces it with a struct member. It also fixes two gchar* memory leaks, and adds better debugging for HTTP failures.

(In reply to comment #10)
> Its amazing! In my opinion imgur is a great service, but perhaps - as you said
> - it would be a good idea to be able to upload to other services with the
> mentioned API before the patch is applied to the main repository.
> 

When I talked to hadess (Bastien Nocera) on #gnome-design, he said that nautilus-sendto integration would be a better fit, and I agreed with him. If this is the planned direction for GNOME 3, then I'll work on that instead.

Also, I suppose someone will need to add photo uploading support to nautilus-sendto. :-)
Comment 12 nodiscc 2012-04-23 09:03:24 UTC
As a temporary solution, or if you need some ideas on this, here a is a script that uses scrot, curl, xclip and libnotify to select an area of the screen and uploads it to imgur (displaying a notification and copying the URL to the clipboard).

https://rxtx-linux.googlecode.com/svn/trunk/misc-scripts/web/screenshot-to-imgur.sh

All credits go to the original author.
Comment 13 Severo Raz 2012-04-23 10:24:27 UTC
The good thing about having this directly integrated with gnome-screenshot is that you would skip saving the image and using nautilus-sendto. 

Another workaround is to use Glippy, a clipboard manager which lets you upload any 
"copied" image to imgur or imageshack.
Comment 14 Nirbheek Chauhan 2012-04-23 11:53:04 UTC
(In reply to comment #13)
> The good thing about having this directly integrated with gnome-screenshot is
> that you would skip saving the image and using nautilus-sendto. 
> 

The nautilus-sendto integration would be inside gnome-screenshot, so the workflow would be similar. It would just support more services and destinations.
Comment 15 Severo Raz 2012-04-23 21:05:39 UTC
Thats even better then! I had no idea
Comment 16 nodiscc 2012-07-28 01:32:08 UTC
*** Bug 340515 has been marked as a duplicate of this bug. ***
Comment 17 Robert Roth 2014-05-02 15:23:03 UTC
*** Bug 705061 has been marked as a duplicate of this bug. ***
Comment 18 hey 2014-08-12 13:26:08 UTC
It would make a lot of sense to connect this to the GNOME Online Accounts. You could simply choose if you want to add this (or share it via) your Google Drive, or your ownCloud, or or or.

If there’s anything you need from ownCloud so we can integrate that, let us know. We use plain WebDAV (as is registered in GNOME Online Accounts) and we have a Share API: http://doc.owncloud.org/server/7.0/developer_manual/core/ocs-share-api.html
Comment 19 Nirbheek Chauhan 2014-09-13 15:11:33 UTC
(In reply to comment #18)
> It would make a lot of sense to connect this to the GNOME Online Accounts. You
> could simply choose if you want to add this (or share it via) your Google
> Drive, or your ownCloud, or or or.
> 

Since the changes to how screenshots are handled in the shell (no UI, automatically saved in ~/Pictures, etc), it's not really clear how this feature could be added. The design team would have to come up with something first, I think.

I couldn't find anything on the wiki, but if someone can point me to a design, I'll be able to work on this again!
Comment 20 Emmanuele Bassi (:ebassi) 2020-11-26 15:42:47 UTC
Having the Shell screenshot action upload to some place is probably never going to work; there are extensions for it, though, like:

  https://extensions.gnome.org/extension/1112/screenshot-tool/

Cloud providers are already integrated in the GTK file selection dialog:

 - NextCloud/OwnCloud
 - Google Drive

Which leaves only image hosting providers, like imgur or paste.xinu.at.

I've opened a new issue on GitLab:

  https://gitlab.gnome.org/GNOME/gnome-screenshot/-/issues/136

We can close this one as obsolete, though, given that the patches do not apply any more.