Your project tags include “browser extension”, I assume you are willing to install something on the client as well?
I can think of an easy way to do this in two clicks without installing anything on the browser, but most browsers block websites from using the clipboard so you would have to copy it from a text box (similar to if you were embedding a YouTube video).
Yeah, installing something on the client would be fine as long as it works for Firefox. Cross browser would be ideal, but Firefox would be the minimum.
I was expecting to have to copy it myself. I wasn’t counting that as a one of the clicks :-). Sorry I wasn’t clear on that.
I was playing around with some code and I created an image re-hoster that takes two clicks - click a button and click the image you want to copy. So far there is no documentation, even in the application itself, so I will be adding that soon. It will work with FireFox, IE, and Opera, with no installation in the browser (the button is a bookmarklet). A PHP script will need to be installed on the server.
I have uploaded the first release. I called it 0.1 but it is actually quite complete and stable. I would like to know if anyone has any problems with it.
gregthe1: My mistake, apparently I relied on a bit of information being present that was only there because of an Apache module I had installed. I have modified the script so that it should work now, although I haven’t thoroughly tested this version so let me know if you run into any problems.
That is awsome! It’s exactly what I wanted. My only complaint is that it seems to require the images folder be writable by owner, group, and other. Does that mean anyone could put an image in that folder over the internet?
I put index.php behind a long randomized URL, so hopefully no one would find it accidentally so it’s probably not a big deal.
The images folder has to be writable by the process that executes the PHP script. Depending on how the server is set up, this could be the user that runs Apache or the user that runs PHP. Also, PHP can be set up to require that the folder be owned by the PHP process. You might be able to get away with only giving the owner write permissions if you figure out what user PHP is run under and you change the folder’s ownership and group to that user.
Anyone who could access the upload site could upload an image. Randomizing the url will work but it is not the ideal solution. I will come up with a better way to keep it secure.
The permissions do make sense then. Should I vote 100% now or do you want to add security first? I’m fine without it. The worst thing someone could do is post pictures to my directory, right?
gregthe1, you are right, the worst someone could do is post pictures to your server. If the plugin does everything you want, feel free to vote it to 100%. All the software is there, the project is just missing some documentation of the extra features. But I think I have met the project’s requirements, and the rest is just documenting the extras. I will release an updated version in the future anyway, weather the project is complete or not.
Great work! I put the slider at 100%. Looks like there are 3 other pledgers whom need to vote?
Can I blog about this, or would you prefer I wait until you perfect it more?
Questions for Micropledge (you can delete these after you answer them):
What does the slider go above 100%? That confusing for me.
Something should tell me when other pledgers are being notified to vote. Does it happen when the first person puts the project at 100%?
So I want to share this project on my blog. Are all the files available to anyone now, even non-registered people? Or should I rather copy the files and host them locally to blog about it? Or Paul, are you going to host it somewhere else on your own for further development?
Thanks Greg. Hopefully these answers will help other people as well. –Ben
The slider goes above 100% so that if you’re real happy with the progress, you can vote say 150% to compensate for the grump who voted say 50%. I’ll put a note to this effect in the tooltip when you vote.
All the pledgers are notified by email at the same time – as soon as Paul made his estimate.
Yes, for an open source project, all files are made public (to the whole internet) after the project’s finished (for this project, as of now). For a really short project like this, I guess there’s not too much advantage with the pledging system. But the advantage of open source projects on microPledge is that if not enough people have pledged to finish the project, then only pledgers get the files. Meaning there’s still security of funds for the developer.
Paul, feel free to release any further files on the uploads/downloads page. It doesn’t matter that the project is already complete.
BTW, Greg, you can test the “are these files available to anyone now” thing by just signing out and then having a look at the project’s downloads page.
Paul, a thumbnail maker would be invaluable. It should also present you with HTML snippets, one for the original and one for the thumbnail and linking to the origanal. What do you think?
gregthe1, I don’t mind if you blog about it, I will probably blog about it soon so feel free to leave your blog URL in the comments and I will link you in my post.
I will continue to update this as an open-source project. I will consider adding a thumbnail maker. If you use WordPress, I wrote a plugin recently that would be useful for resizing images that were uploaded with the image re-hoster, it can be found here: http://www.paulbutler.org/archives/proper-image-resizing-for-wordpress/. You would just have to make images upload to the wordpress upload directory.
A thumbnail maker would be a very natural fit for this project. I use the non-WSIWYG editor for WordPress so you’re plugin wouldn’t help me unfortunately.
Perhaps you can copy the code that this guy uses to make the thumbnails. I think it’s open source.
Thanks for the link. I will be posting about it in a few days. By the way, my WordPress plugin works even if you don’t use the Wysiwyg editor, but you need to specify both the height and width of the image. In the future you will only have to specify one and the plugin will figure out the other from the aspect ratio.
By the way, hiding the script behind a random URL only works if you change the upload directory (the configuration options are at the top of the PHP file and should be fairly easy to figure out because they are well-commented). Currently I can right-click your image and see where the script is installed based on the image’s path.
I have uploaded the latest version (0.3). IT IS IMPORTANT THAT YOU UPDATE because 0.2 and prior versions had a huge security issue that I don’t know how I missed.
gregthe1: Thanks for the bug report. I have fixed this, although it doesn’t yet strip GET parameters so you will get a weird filename.
I have also added an optional password, read the PHP configuration (in the index.php file) for instructions on how to use it.
Thanks for the update, Paul. The script seems to run slowly now (10-30 seconds). Of course it could just be my web hosting company acting up. Would you mind checking if it’s slow for you?
Hmm, doesn’t seem to be working at all now. For example I’m trying to do the main image on this page:
http://www.flickr.com/photos/candanguinho/1150193576/
Greg, you are right, it was slow and broken for me too. Unfortunately I had to rush the last release as I wanted to fix the security flaw I discovered before going away for the weekend. In my hurry I not only broke the software, but I didn’t actually fix what I intended to fix. I put version 0.4 up now, it should fix the problems you are having. Again, in my rush to get a more secure version out there I haven’t had much of a chance to test it, so let me know how it goes.
By the way, I did add the password security feature in 0.3, but I haven’t documented it except in the PHP source code. If you want to password-protect the script, read the source code for instructions.
You’re right, I tried logging out and I can’t see the file.. I think it may be me misunderstanding the release system rather than a bug. I re-uploaded it as part of the current release, hopefully it will work now.
Well your download link did work, but it’s still not showing on the downloads page. Micropledge, could you check on this? And feel free to delete the comments talking about the potential micropledge bug.
Hi guys, it’s not quite a bug, but it is a bad design. :-) “Upcoming release” doesn’t make sense for completed projects – upcoming releases are only visible to the developer, and no more estimate/vote cycles will take place on a finished project. Fixed now, and I’ve modified the downloads page a little so all this is a bit clearer. :-)
(So Paul, I moved your version 0.5 download to the 100% release and also updated the link in your comment above.)
32 comments (oldest first)
Your project tags include “browser extension”, I assume you are willing to install something on the client as well?
I can think of an easy way to do this in two clicks without installing anything on the browser, but most browsers block websites from using the clipboard so you would have to copy it from a text box (similar to if you were embedding a YouTube video).
Yeah, installing something on the client would be fine as long as it works for Firefox. Cross browser would be ideal, but Firefox would be the minimum.
I was expecting to have to copy it myself. I wasn’t counting that as a one of the clicks :-). Sorry I wasn’t clear on that.
I was playing around with some code and I created an image re-hoster that takes two clicks - click a button and click the image you want to copy. So far there is no documentation, even in the application itself, so I will be adding that soon. It will work with FireFox, IE, and Opera, with no installation in the browser (the button is a bookmarklet). A PHP script will need to be installed on the server.
I have uploaded the first release. I called it 0.1 but it is actually quite complete and stable. I would like to know if anyone has any problems with it.
– Paul
Hi Paul,
I put the code (unedited) in a new directory on my server and navigated to that folder in the browser:
It printed this message above the content: “Notice: Undefined index: SCRIPT_URI in /nfsn/content/answermysearches/htdocs/ah…g/index.php on line 22”
Then it correctly printed the rest of the content but without any styling. …. without styling because style sheet tag says:
Notice: Undefined index: SCRIPT_URI in /nfsn/content/answermysearches/htdocs/ahidd8aryyar2315kjkadag3/index.php on line 96 ?css” type=”text/css” />
gregthe1: My mistake, apparently I relied on a bit of information being present that was only there because of an Apache module I had installed. I have modified the script so that it should work now, although I haven’t thoroughly tested this version so let me know if you run into any problems.
That is awsome! It’s exactly what I wanted. My only complaint is that it seems to require the images folder be writable by owner, group, and other. Does that mean anyone could put an image in that folder over the internet?
I put index.php behind a long randomized URL, so hopefully no one would find it accidentally so it’s probably not a big deal.
I’m glad you like it.
The images folder has to be writable by the process that executes the PHP script. Depending on how the server is set up, this could be the user that runs Apache or the user that runs PHP. Also, PHP can be set up to require that the folder be owned by the PHP process. You might be able to get away with only giving the owner write permissions if you figure out what user PHP is run under and you change the folder’s ownership and group to that user.
Anyone who could access the upload site could upload an image. Randomizing the url will work but it is not the ideal solution. I will come up with a better way to keep it secure.
The permissions do make sense then. Should I vote 100% now or do you want to add security first? I’m fine without it. The worst thing someone could do is post pictures to my directory, right?
gregthe1, you are right, the worst someone could do is post pictures to your server. If the plugin does everything you want, feel free to vote it to 100%. All the software is there, the project is just missing some documentation of the extra features. But I think I have met the project’s requirements, and the rest is just documenting the extras. I will release an updated version in the future anyway, weather the project is complete or not.
Great work! I put the slider at 100%. Looks like there are 3 other pledgers whom need to vote?
Can I blog about this, or would you prefer I wait until you perfect it more?
Questions for Micropledge (you can delete these after you answer them):
What does the slider go above 100%? That confusing for me.
Something should tell me when other pledgers are being notified to vote. Does it happen when the first person puts the project at 100%?
So I want to share this project on my blog. Are all the files available to anyone now, even non-registered people? Or should I rather copy the files and host them locally to blog about it? Or Paul, are you going to host it somewhere else on your own for further development?
Thanks Greg. Hopefully these answers will help other people as well. –Ben
BTW, Greg, you can test the “are these files available to anyone now” thing by just signing out and then having a look at the project’s downloads page.
Paul, a thumbnail maker would be invaluable. It should also present you with HTML snippets, one for the original and one for the thumbnail and linking to the origanal. What do you think?
gregthe1, I don’t mind if you blog about it, I will probably blog about it soon so feel free to leave your blog URL in the comments and I will link you in my post.
I will continue to update this as an open-source project. I will consider adding a thumbnail maker. If you use WordPress, I wrote a plugin recently that would be useful for resizing images that were uploaded with the image re-hoster, it can be found here: http://www.paulbutler.org/archives/proper-image-resizing-for-wordpress/. You would just have to make images upload to the wordpress upload directory.
Here is my blog post about it
A thumbnail maker would be a very natural fit for this project. I use the non-WSIWYG editor for WordPress so you’re plugin wouldn’t help me unfortunately.
Perhaps you can copy the code that this guy uses to make the thumbnails. I think it’s open source.
Thanks for the link. I will be posting about it in a few days. By the way, my WordPress plugin works even if you don’t use the Wysiwyg editor, but you need to specify both the height and width of the image. In the future you will only have to specify one and the plugin will figure out the other from the aspect ratio.
By the way, hiding the script behind a random URL only works if you change the upload directory (the configuration options are at the top of the PHP file and should be fairly easy to figure out because they are well-commented). Currently I can right-click your image and see where the script is installed based on the image’s path.
Bug: images that don’t end in a normal file extension aren’t accepted. Example
It sounds minor except that Flickr seems to often put GET parameters after an image.
I have uploaded the latest version (0.3). IT IS IMPORTANT THAT YOU UPDATE because 0.2 and prior versions had a huge security issue that I don’t know how I missed.
gregthe1: Thanks for the bug report. I have fixed this, although it doesn’t yet strip GET parameters so you will get a weird filename.
I have also added an optional password, read the PHP configuration (in the index.php file) for instructions on how to use it.
Thanks for the update, Paul. The script seems to run slowly now (10-30 seconds). Of course it could just be my web hosting company acting up. Would you mind checking if it’s slow for you?
Hmm, doesn’t seem to be working at all now. For example I’m trying to do the main image on this page: http://www.flickr.com/photos/candanguinho/1150193576/
Greg, you are right, it was slow and broken for me too. Unfortunately I had to rush the last release as I wanted to fix the security flaw I discovered before going away for the weekend. In my hurry I not only broke the software, but I didn’t actually fix what I intended to fix. I put version 0.4 up now, it should fix the problems you are having. Again, in my rush to get a more secure version out there I haven’t had much of a chance to test it, so let me know how it goes.
By the way, I did add the password security feature in 0.3, but I haven’t documented it except in the PHP source code. If you want to password-protect the script, read the source code for instructions.
Make that 0.5; I somehow forgot to support PNG in 0.4.
I’m not seeing 0.5?
Greg, here is a direct link: http://micropledge.com/projects/image-re-hoster/downloads/1/imagerehoster-0.5.tar.gz
I put it under “upcoming release” by mistake, but it should be on the download page anyway. I still see it there.
Micropledge, is that a bug that I’m not seeing that?
You’re right, I tried logging out and I can’t see the file.. I think it may be me misunderstanding the release system rather than a bug. I re-uploaded it as part of the current release, hopefully it will work now.
Well your download link did work, but it’s still not showing on the downloads page. Micropledge, could you check on this? And feel free to delete the comments talking about the potential micropledge bug.
Seems to work, though on this image http://i144.photobucket.com/albums/r180/taossa/cover_sm.png I got this warning:
Notice: Undefined offset: 6 in /nfsn/content/answermysearches/htdocs/ahidd8adggae315kjkadag34err/index.php on line 412
Hi guys, it’s not quite a bug, but it is a bad design. :-) “Upcoming release” doesn’t make sense for completed projects – upcoming releases are only visible to the developer, and no more estimate/vote cycles will take place on a finished project. Fixed now, and I’ve modified the downloads page a little so all this is a bit clearer. :-)
(So Paul, I moved your version 0.5 download to the 100% release and also updated the link in your comment above.)
Greg, I have uploaded a new version (0.6) that fixes this. Sorry it took so long, I had another project that was keeping me busy.
Add a comment
Before you add a comment you must be signed up – it takes about 30 seconds. Sign up now.