Jump to content

adding images to msql


desjardins2010

Recommended Posts

hey guys gals

 

can someone tell me I'm setting up a DB that I want to hold an image how do I accomplish this in phpmyadmin?? 

 

second question is does anyone know of a way that I can set something up that will with a provided url take a screen shot of the site and store that image in the db 

 

say I setup an admin section that I enter these sites into to be stored... anyway of instead of providing the image i provide a url that when the script is ran it enters the details I provide into DB and takes screen shot and saves image for use later on

Link to comment
Share on other sites

There are many services that can show a website image with a given url

Some are free but usually have limitations such as views,a watermark image,limited sizes or can only snap main domains. Sometimes their paid versions can do additional, not always though.

 

Just a few of them, can do searches for more.

http://www.shrinktheweb.com/

http://www.websnapr.com/

http://www.thumbshots.com/

http://webthumb.bluga.net/home

 

Making a thumbnail snapshot server takes a lot of work.

 

As far as I know is none that can render flash as a snapshot in linux.

http://code.google.com/p/wkhtmltopdf/ (has wkhtmltoimage)

http://pielmeier.blogspot.com/2011/02/headless-html-page-rendering-with.html

http://cutycapt.sourceforge.net/

 

For windows can use php's imagegrabscreen() or imagegrabwindow()

 

Is a few programs not server side but applications that can insert urls or can do urls from lists.

http://www.websitescreenshots.com/

http://www.ducklink.com/p/command-line-screen-capture/

 

 

I'll explain how I do my snapshot server, maybe will help or not.

 

I use a windows server.

save images as 40% of original image at 1024x768 resolution for browser, approx 400px

save all images as md5 and png

 

I myself have used a combination of methods.

using webshot, and running lists of urls through it multiple machines

exec firefox and use a plugin https://addons.mozilla.org/en-US/firefox/addon/pagesaver/

php scripts and use imagegrabwindow and internet explorer

 

For all the above I save to the same central folder.

I made my thumbnail server more of an "on the fly design", I do not store their locations in a database.

My php script will fetch GET parameters, and depending on those will output various types of thumnails using GD

 

I check if the image exists using file_exists() and by creating url locations to check against.

I parse the urls with parse_url() to get the domain and subdomains, also made my own function to get main domains from subdomains.

You can use an if/else() statement or a switch() depending if you want to use the first image it finds, or continue looking for a best or preferred image, such as the parsed one

I first look for exact image inserted, then a parsed one, then it continues with a lot of popular file types such as with or without http or https, www. with or without end slashes, locations such as index.php,index.html, index.asp and so on, I made an array for any file patterns i want to look against.

If a match is found will display that image resized and output to the browser using gd, I do not save them in cache, but you can if wanted to.

If no image is found I then execute to snap the image.

You can determine what image to snap, like either the parsed domain, or the full url inserted.

 

I have been using my system around 4 years now with no issues, over 10 million estimated images stored and haven't seen an issue.

Just don't try and browse a folder storing that many images.

 

And you can try my thumbnail server out if you want.

http://dynaindex.com/snapshot.php

 

And here is just one example of my snapshot images

http://dyna.dyndns.tv/url-thumb.php?size=400&text=HOST&textsize=10&textcolor=aqua&url=http://www.phpfreaks.com/

Edited by QuickOldCar
Link to comment
Share on other sites

This thread is more than a year old. Please don't revive it unless you have something important to add.

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.   Restore formatting

  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...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.