Board index   FAQ   Search  
Register  Login
Board index php forum :: php coding PHP coding => Images

Block and dots on images

images php coding issues or problems here.

Moderators: macek, egami, gesf

Block and dots on images

Postby mooret1979 » Mon Jun 23, 2014 8:26 am

I have created a SQL command to retrieve an image from a MS SQL database. For some strange reason the images are distored but not all in the same way. It seems to get progressively worse. I have attached screen shots. The program that puts the images in the SQL database was checked and they are not distorted. My code is below with screen shots:

[img]
1.jpg
[/img]
[img]
2.jpg
[/img]
[img]
3.jpg
[/img]

Code: Select all
 <?PHP
        $sq16="SELECT TOP 1 * FROM VSI_DATA.dbo.IMAGES WHERE VSI_DATA.dbo.IMAGES.MASTER_NAME_LINK ='".$MasterNameLink."' AND VSI_DATA.dbo.IMAGES.CASE_NUMBER ='".$ArrestCaseNumber."'";
       $rs16=odbc_exec($conn,$sq16);
        if(!$rs16)
        {exit("Error in SQL");}
        while (odbc_fetch_row($rs16))
        {   
      $contentIMG=odbc_result($rs16, "The_ThumbNail");
      $contentIMG2=odbc_result($rs16, "The_Image");
      $ImageType=odbc_result($rs16, "Type_Image");
      //Already in HEAD of document header('Content-type: image/jpeg');
      $imgurl = $rs16['The_image'] ; 
      echo '<img src="data:image/jpg;base64,'.base64_encode($contentIMG).'"  />';
      
        }
Attachments
3.jpg
more blocks than first two
3.jpg (28.71 KiB) Viewed 142 times
2.jpg
more blocks than first
2.jpg (19.21 KiB) Viewed 142 times
1.jpg
more blocks
1.jpg (22.53 KiB) Viewed 142 times
mooret1979
New php-forum User
New php-forum User
 
Posts: 2
Joined: Mon Jun 23, 2014 8:14 am

Re: Block and dots on images

Postby mooret1979 » Sun Jun 29, 2014 2:50 pm

i figured it out. The images were not converting the all the string from MSSQL. I had to go into the php.ini file and change the odbc.defaultlrl from 4096 to 10096. It resolved the issue without any other code change on the webpage.
mooret1979
New php-forum User
New php-forum User
 
Posts: 2
Joined: Mon Jun 23, 2014 8:14 am


Return to PHP coding => Images

Who is online

Users browsing this forum: No registered users and 1 guest

Sponsored by Sitebuilder Web hosting and Traduzioni Italiano Rumeno and antispam for cPanel.