Jump to content
How to Install Plugins ×

Upload to... v2.6


Simon Brown

Recommended Posts

MODERATORS NOTE:  this plugin no longer functions, and is no longer available.
 
 

Uploading images to the internet is common nowadays, and yet it still takes effort to save the image to one's hard-disk, go to a photo hosting service, find the image in your badly organized file-system and copy the link. This plugin allows you to just flatten the image, select Effects -> Tools -> Upload to... and follow the on-screen instructions.

LiubS.png

rXoxt.png

Hidden Content: How to add Photobucket support.

Download PhotobucketNet, rename it to PhotobucketNet.dll and place it in the same folder (Paint.NETEffects) as UploadTo.

Edited by toe_head2001
KaHuc.png
Link to comment
Share on other sites

YES! This is like a built in QuickShot. Very awesome Simon, thank you.

EDIT: Got an "upload failed" message. I think it's because the image size was larger than 1.5mb. Would there be a way of implementing an image compressor type thing? Not necessarily a resizer... but as in Quick Shot, where it somehow magically gets the image onto the web without resizing or too much quality loss.

"pyrochild, you're my favorite person ever. We should go snowboarding some time."~ 007 Nab. Ish.

PDN Gallery | I Made a Deviant Art!

Link to comment
Share on other sites

I guess I could do that automatically if I knew ImageShack's maximum size. I guess I could have it use JPEG automatically, but that wouldn't support transparency. Allowing the user to configure the upload would, of course, mean another click (at the least) for the user.

KaHuc.png
Link to comment
Share on other sites

Still better than necessarily opening up a whole new web window. I wouldn't mind having to go through a couple of buttons.

Do you know what Quick Shot uses to compress the PNGs? Maybe that could be implemented.

"pyrochild, you're my favorite person ever. We should go snowboarding some time."~ 007 Nab. Ish.

PDN Gallery | I Made a Deviant Art!

Link to comment
Share on other sites

Ugh... I dunno about straight resizing. Could there be a combination of quality-loss and resizing? So there is less resizing involved?

I'll check out the update when I can.

"pyrochild, you're my favorite person ever. We should go snowboarding some time."~ 007 Nab. Ish.

PDN Gallery | I Made a Deviant Art!

Link to comment
Share on other sites

I may do it with Photobucket, but I havn't heared of a dA API. If you can find an API for a popular photo upload service I will consider adding support.

KaHuc.png
Link to comment
Share on other sites

Just one PhotoBucket - not the entire plugin.

yes of course :lol: , i think photobucket is really famouse and has so many people even in his forum, i noticed many useing it, imageshake is still good but i started my pictures in photobucket because of the storage and bandwidth.

so still :mrgreen: hope photobucket appear, and

HOPE 2 SEE OTHER IDEAS LIKE THIS APPEAR :twisted:

those are other things that for sure will make Paint.NET really stand out :P

Link to comment
Share on other sites

Is anyone interested in me posting imageshack.cs and details of the methods provided to easily perform a POST to allow people to add new sites to be included in future versions?

KaHuc.png
Link to comment
Share on other sites

That would be most helpful, as I've been considering writing a plugin to automatically FTP an image to my web host and would like to use yours as a base.

Link to comment
Share on other sites

That would be most helpful, as I've been considering writing a plugin to automatically FTP an image to my web host and would like to use yours as a base.

hope you add it tp photobucket. 8)

Link to comment
Share on other sites

Here is ImageShack.cs:

using System;
using System.Collections.Generic;
using System.Text;
using System.Drawing;
using System.IO;
using System.Collections.Specialized;
using System.Net;
using System.Xml;
using System.Windows.Forms;

namespace ImageShackUpload.UploadSites
{
   public class ImageShack : SiteInterface
   {
       String SiteInterface.Name()
       {
           return "ImageShack";
       }

       String SiteInterface.TokenUrl()
       {
           return "http://profile.imageshack.us/registration/";
       }

       Boolean SiteInterface.AllowsGuests()
       {
           return true;
       }

       String SiteInterface.UploadImage(Image image, String token)
       {
           NameValueCollection queryString = new NameValueCollection();
           queryString["xml"] = "yes";
           if (!String.IsNullOrEmpty(token)) queryString["cookie"] = token;

           String tmpHome = Path.Combine(Path.GetTempPath(), "szhxndxksmmws.png");
           image.Save(tmpHome);
           String returnMessage = PostTools.UploadFileEx(
                   tmpHome, "http://www.imageshack.us/index.php",
                   "fileupload", "image/png", queryString, new CookieContainer());
           File.Delete(tmpHome);

           return returnMessage;
       }

       UploadedImage SiteInterface.ParseResponse(String response)
       {
           XmlDocument responseDoc = new XmlDocument();
           responseDoc.LoadXml(response);

           XmlNode linkList = ((XmlDocument)responseDoc).GetElementsByTagName("links")[0];

           UploadedImage uploadedImage = new UploadedImage();

           uploadedImage.Hyperlink = Helpers.FindChild(linkList, "ad_link").InnerText;
           uploadedImage.DirectLink = Helpers.FindChild(linkList, "image_link").InnerText;

           return uploadedImage;
       }
   }
}

To more easily do a POST use the following method:

PostTools.DoPost(String url, String args);

The token variable is what the user typed in as their registration code. The "token url" is the web address the user is sent to if they click the link to tell them how to construct this code. You'll need to find a way to compact all details into this one box, I didn't allow UI customisation to avoid complicating things. If you don't have a website to host the instructions either use TinyPaste or simply post them in this thread.

Post any sites you add support for and I will consider adding them. (and, of course, give you credit) If your site requires an API key leave it out and I will register and add my key in.

KaHuc.png
Link to comment
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...