Loading...
Logo
Processing Forum
Noob here,
I'm able to scrape images from a URL using proHTML, but I want the original size of the images, not the reduced thumbnail.

I realize that the images on the URL are thumbnails - but it would be great to get the original size. Is this possible? Easy?

My Code:
import prohtml.*;

HtmlImageFinder htmlImageFinder;

int rand15 = int(random(1,15));
int rand30 = int(random(15,30));
int rand45 = int(random(30,45));

//insert your url here
htmlImageFinder = new HtmlImageFinder("http://film-grab.com/2010/07/06/2001-a-space-odyssey/");


PImage[] images = new PImage[htmlImageFinder.getNumbOfImages()];
println(htmlImageFinder.getNumbOfImages());
size(512,238*3);

try{
 for(int i = 0;i<50;i++){
   images[i] = loadImage(htmlImageFinder.getImageLink(i));  
   //images[i].resize(300,160); 

   println(htmlImageFinder.getImageLink(i));
 }

    image(images[rand15],0,0); 
    image(images[rand30],0,238); 
    image(images[rand45],0,238*2); 
// }

}

catch (NullPointerException e) {


}

Replies(3)

The images are clickable, so you probably need to follow the link to get the full size image.
For example, I see one thumbnail points to the http://filmgrab.files.wordpress.com/2010/07/14-hallway1.png image, that's the URL to download.
Hmm yeah... I was afraid that may be the case.
That would mean that I'd have to load and search each individual URL, if I wanted all the images from that page, correct?

Thanks for your quick response!


I solved the problem by just simply splitting the imageURL, removing the "?w=150&" which I guess was reducing the width to 150. Resolution and size is perfect.


 String betterPic = htmlImageFinder.getImageLink(rand15);
 String[] picture1 = split(betterPic,"?w=150&");