Saving a web url to filepicker.io - filepicker.io

Given some image url, is there a simple way to upload this to filepicker? I want to do this for two reasons:
So that I'm not consuming the image hoster's bandwidth/bugging them
So that I can easily resize the image
I feel like this could be done with a read and then store call to filepicker; is this the way I should do it?

storeUrl, of course!
I missed this because it's under the "store" section, and there's not a "storeUrl" section. I also expected store to just take a url, I'm not sure why these are two separate methods, but I presume there's some good reason.

Related

Copying images in from anti-scraper websites. Google Docs handles it easily - anyone know how?

I've been playing around with making a draftjs plugin that lets the user paste in mixed text&image content from websites and have images auto-uploaded to the server. I've quickly come to the realization that it's not easy, simply because of how many different sites use different kinds of counter-measures for copy/pasting images. Standard image tags in page content are no problem - easily grab the src and handle the file upload from the url. However, many sites use all kinds of trickery to make this a pain. For example, some will only serve small thumbnails, requiring a GET request on the image with a hash key in order to retrieve a larger version. Others somehow seem to corrupt the image so that it's unreadable by the time it's been retrieved. Others still play with weird embed tags to mess with draftjs' image blocks.
But then I open up a Google Docs file, and find that when I copy any images into that from a website, there's never any troubles whatsoever. All the problematic websites that I'm finding myself having to write specific methods for retrieving from seem to be handled by Google Docs with ease.
Am I using completely the wrong approach by trying to retrieve images from a url? Does Google use a far superior approach (yes, I presume) - in which case, does anyone have any idea what that approach might be?

obscuring / securing filepicker / filestack urls

I use filepicker to serve resized / cropped / watermarked images on a website. I use the regular URL based API to do this: e.g. a url might look like https://.../convert?h=400&w=600&fit=crop&quality=80&format=jpg&cache=true
This obviously allows a lot of flexibility for sizing images on the fly and so on. However, it also means that anyone can get the original un-cropped, un-watermarked image by removing the parameters at the end of the URL.
Is there any way around this short of creating a proxy server that could un-encode an encoded string?
For the latest version, it seems you need to add in your API key to the URL as well - what would stop someone else from using my API key? Are these URLs really meant to be used on a production website in the <img> tags? or for creating a resized image to download, store and ultimately serve up to the end user?
We have updated our processing engine so that it is no longer necessary to pass an API key if you are transforming an image based on its Filestack Handle:
https://process.filestackapi.com/watermark=file:ZoVdwbe6Qcu9uIxIZSuU/h2T4Jl9RBSSXOGtl0gv8
However, a user could still get the image without the watermark. So, we also have a store method built into the processing engine:
Posting the image with our store task attached:
curl -X POST -g "https://process.filestackapi.com/store/watermark=file:ZoVdwbe6Qcu9uIxIZSuU/h2T4Jl9RBSSXOGtl0gv8"
Will return the following:
{"filename":"photo-1435771112039-1e5b2bcad966.jpg","height":750,"size":67588,"type":"image/jpeg","url":"https://cdn.filestackcontent.com/62aWdbPvQzWNrl90C7q9","width":1000}
Which is a saved version of the watermarked image, so the watermark cannot be removed:
https://cdn.filestackcontent.com/62aWdbPvQzWNrl90C7q9
We recommend using the newer method but you should also set up security so that people can't hotlinking to your content.
https://www.filepicker.com/docs/security/
I would also recommend move over to Filestack as it we have rebuilt all the infrastructure.

What's the best way to download multiple images and display multiple UIImageView?

I need to download images from a website and display them on(?) multiple UIImageView.
Maybe I'll code a php to "read" the directory and search for images, write a XML file and use it as medium. But I'm not sure if it's the best way.
Let's see the options you have to fetch images from a website:
Fetching HTML and Parsing the HTML to find the images (on the iphone). Then downloading the images.
Writing a script (maybe PHP) that writes all image links to an XML file (or JSON), and then fetch the output of your script with all the links.
If you choose option (1) you'll need NSURLConnection to fetch data asynchronously (without blocking the UI). I would also use TFHpple to parse HTML using xpath queries, see this tutorial for help. Finally to fetch the images using their URLs you can use SDWebImage, SDWebimage also provides caching so your app will not download the same image multiple times.
The bad side of using option (1) is that any change in the Website you're getting the images from will break your app and you'll need to issue an update to the app store in order to fix it.
If you choose option (2), your app will be easier to fix if the website changes, you'll just need to modify your script.
If you go with option (2) you'll probably need NSURLConnection, NSXMLParser (or a third party XML parsing library) and to download the images I would recomend SDWebImage again. I would also advise using JSON (and NSJSONSerialization) instead of XML, just beacuse I find JSON easier to parse.
Yes, it will be very good if you write some php script to get image list (list of image urls).
After getting such urls you can asynchronously download and show them in image views. Look here for such async image view implementation

Best way to load a lot of images from a server in iphone

I'm developing an app and one of its features is similar to twitter,so I have a table with each "tweet" and I display the user's picture too and I don't know what is the best way to load a lot of pictures. The images come from the server as an url.
My app's structure is:
1- I call to the server, and I get the response
2- I parse the response and I iterate it creating objects
3- I load that objects in the tableview's store
4- I reload the table
I thought one way is when I am creating the object, I load the image and I assign to the object's attribute. I mean, each time I create a object type "tweet" for example, I create the image calling the url with nsdata...
I dont know if that solution is correct or can be better. Can anyone give me a hand? Thanks in advance
Take a look at the SDWebImage API. It will do much of this automatically for you.

Filepicker.io - image conversions preventing video uploads

We're currently working with Filepicker.io to allow users the ability to upload both images and videos. It appears that if we specify image conversions in the Javascript API options, video uploads don't process and instead get stuck at 99.30%. If I remove the 'conversions' option, video uploads process without issue. Is it not possible to specify image conversion options and accept both type of uploads? If so, this should really be specified in the docs.
I attached a JSFiddle with the code in question. http://jsfiddle.net/BYkD4/
It might be an issue on our end, taking a look now. For large files (+1Mb) we split the file into chunks, upload them in parallel, and then reassemble them on the server side. We use browser progress up to the 90% mark, after which we have to "best guess" what the server-side progress looks like, for now at least. That's the reason why it's hanging at 99.30% - it may actually be able to complete if you give it enough time.
In any case, looking into it
Edit: looks like this was an issue on our end. Fix deployed, everything should be working fine. Sorry about the issue