|
|
|||||||||
|
|||||||||
|
|||||||||
| |
|||
| |||||||||
![]() |
|
|
«
Previous Thread
|
Next Thread
»
|
Thread Tools | Search this Thread | Display Modes |
|
|
|
Stay one step ahead of the competition. Evaluate and give feedback
on some of the hottest web development tools on the market today.
Make your opinion heard! Click
Here
|
|
#1
|
|||
|
|||
|
Hello everybody.
I read the article about blobbing images with PHP and MySQL: http://www.devarticles.com/art/1/68/2 What the author does to display an image is to create a new page, and send a header to indicate to the browser that it has to display an image. This technique, as far as I know, doesn't work if you want to display the image somewhere in a html-page. I know it can be done by first writing the contents of the image into a temporary file, and then displaying that file with <img src...> What I would like to know if the latter can also be done without creating the temporary file, straight from the database to the browser. Anybody?? Thanx in advance, Marco Teeuwen http://www.mct-it.nl |
|
#2
|
|||
|
|||
|
don't bother with blob ... it slows down the db and makes working with any kind of php/mysql manager like phpMyAdmin less effective.
Instead locate you images somewhere on the server in any number of directories depending on how you want to organzie them. Then design you db and write your scripts to reference those locations, rather than the images themselves Take a look at URL to see how it works for me. There's excellent js in the source code for complete prevention of any right click functionality to save your images and while nothing is perfect, it makes it a bit harder to violate your copyright. Good luck peter |
|
#3
|
|||
|
|||
|
Thanx for the advice.
Btw, that is the first right-click prevention script I see, that really works! I've had several of those, but each one of them could be circumvented with the right combination of clicks. Thanx Marco |
|
#4
|
|||
|
|||
|
Peter,
Although the disabling of the right click works in this case, there's always a workaround... If you're concerned about people "stealing" your images... Consider putting a small watermark with your name on the one of the corners... As long as it's not so big that it distracts from the image itself.
__________________
____________________________________________ Developer Shed Weekly Writer | DevArticles Forum Moderator Build Your Own KlipFolio Klip With PHP FrankManno.com - Under Construction Design Interactive Group - Under Construction |
|
#5
|
|||
|
|||
|
Re: skip the blob
Quote:
![]() |
|
#6
|
|||
|
|||
|
the point is this
you're probably right ... the reason i mention this is the first place is this. Try doing a table dump when you have 500-1000 images in a db with the image contained in a blob .... that's alot of data on your screen.
Plus, by referencing the location of the image with your database record, you don't have to create a file with an image header just to render the image. You simply call the record that points to your image, and bingo there it is. Either way is probably fine, but having done both, i find it much easier to maintain and evolve a gallery without using the blob field. cheers, peter |
|
#7
|
|||
|
|||
|
if you want to call a blob image into your html page, then you will need to call the image in the following manner.
<img src="download.php?blobId=1"> This would call the php file which would display the image based on the blob id. |
|
#8
|
|||
|
|||
|
Kylie,
thanx, that'll be the way I didn't know about. I'll check it out. PCole, I'm not sure which way to go yet, it's the first time I used images in combination with a database. I'll try both methods. Thanx for the advice! McTrex |
|
#9
|
|||
|
|||
|
I also ever create a tutorial for that scheme.
Follow this tutorial to find it out. |
|
#10
|
|||
|
|||
|
imagecopyresample to img html tag
Hi! figure this:
You want to create a web photo album, you decide to store your images in your server but all the references about the picture are in a mysql database so, you store additional information about the picture in the database with the name of the image, then in the display script you set de directory name as the name were the images are stored and join it with the name of the image to display. OK? But, you want to make the thumbnails of the pictures on the fly using imagecopyresample function. How can I display this dynamicly generated thumbnail in a img tag? I can do the whole thing for one image sending a header but I just don't know how it can be done sending the image to a img tag. I hope some of you can help me. |
![]() |
| Viewing: Dev Articles Community Forums > Databases > MySQL Development > Displaying images from MySQL |
| Thread Tools | Search this Thread |
| Display Modes | Rate This Thread |
|
|
|
|