Jump to content


Photo

Imagecreatefromstring() function


  • Please log in to reply
3 replies to this topic

#1 aNubies

aNubies

    Advanced Member

  • Members
  • PipPipPip
  • 31 posts

Posted 26 March 2013 - 12:18 AM

Alright im testing the imagecreatefromstring() function, but it always give me an error saying "data is not recognized format". This is base on my previous post that what i want to do is convert my .pix file which is a map file into a jpeg file.

 

I tried to read the stream before converting it into the function but no luck, same with file_get_contents but no luck also.

 

Help here please. Thank you in advance.



#2 Barand

Barand

    Sen . ( ile || sei )

  • Gurus
  • 14,187 posts
  • LocationCheshire, UK

Posted 26 March 2013 - 04:28 PM

It would have been better if this post were in the same thread as your other one so people know what you are talking about.

 

However, I did read the other one.

 

What you will need to do, as the pix filetype is not one recognised by the GD library, is

 

  • create a new gd image
  • read the pix file and get the colour values for each pixel (using the pix file format definition I pointed you to)
  • set the corresponding pixel value in the gd image
  • save gd image as jpeg

|baaGrid| easy data tables - and more
|baaChart| easy line, column and pie charts
|baaSelect| generate js and php code for dynamic linked dropdowns

 


#3 aNubies

aNubies

    Advanced Member

  • Members
  • PipPipPip
  • 31 posts

Posted 26 March 2013 - 08:20 PM

Okay barand, I'm gonna give it a shot. Thank you.



#4 aNubies

aNubies

    Advanced Member

  • Members
  • PipPipPip
  • 31 posts

Posted 31 March 2013 - 09:27 PM

Sir Barand, I saw a convertbmptogd function yet it won't recognize the .pix file. Do you have any other way how to read the color values of the .pix file?






0 user(s) are reading this topic

0 members, 0 guests, 0 anonymous users

Cheap Linux VPS from $5
SSD Storage, 30 day Guarantee
1 TB of BW, 100% Network Uptime

AlphaBit.com