1

How i can decrypt the encrypted image. The image descryption is showing like.

ÿØÿà�JFIF��–�–��ÿþ�.Handmade Software, Inc. Image Alchemy v1.11
ÿÛ�„�

#!!!$'$ & !                                                    ÿÀ�àg!�ÿÄ¢���������� 
������� 
���}�!1AQa"q2‘¡#B±ÁRÑð$3br‚ 
%&'()*456789:CDEFGHIJSTUVWXYZcdefghijstuvwxyzƒ„…†‡ˆ‰Š’“”•–—˜™š¢£¤¥¦§¨©ª²³´µ¶·¸¹ºÂÃÄÅÆÇÈÉÊÒÓÔÕÖרÙÚáâãäåæçèéêñòóôõö÷øùú��w�!1AQaq"2B‘¡±Á #3Rð

This image is coming from the RETS API. I am using the PHRETS Library to get the data. This Library is in the PHP. The function used to get the image data as:

$objects = $rets->GetObject('Property', 'Photo', '61555', '*', 0);
foreach ($objects as $photo) {
 $photo = $photo->getContent();
 if($photo){
 echo "<hr><pre>";
 var_dump($photo);
 echo "</pre><hr>";
 }
}
junkk rr
  • 55
  • 15
  • JFIF is [JPEG File Interchange Format](https://en.wikipedia.org/wiki/JPEG_File_Interchange_Format) – samgak Jul 24 '16 at 07:51
  • @samgak how can i convert it into the original image URL. can you provide me any idea about it.? Because i need to save the image URL into the database. – junkk rr Jul 24 '16 at 07:58
  • It's not a URL. It looks like the actual image data. – samgak Jul 24 '16 at 08:02
  • How can i convert it into the image URL.? so that i can paste it into browser to get the actual image.? – junkk rr Jul 24 '16 at 08:04
  • @samgak can you help me with that.? – junkk rr Jul 24 '16 at 08:33
  • If you want to display that in a browser using an URL you'd have to base64 encode it as a data URI. Or else save the image somewhere and link to it. However I'm still totally confused about what you are trying to do. Is this iOS? – samgak Jul 24 '16 at 09:03
  • No @samgak bro, its the RETS API. they provides real estate information through its API. and whole task i have done except this image encryption. – junkk rr Jul 24 '16 at 10:30
  • You need to edit your question to give us a lot more information about your problem. Tell us what programming languages you are using, how you are getting the data, and how you want to display it. We don't even know if this is a mobile app, a desktop app or a web app. Add more details and people can help you more. – samgak Jul 24 '16 at 11:33
  • @samgak i have edited the question. Please read it and give me solution if you can understand.Thnx. – junkk rr Jul 25 '16 at 06:23

1 Answers1

0

$photo contains raw JPEG image data. You can display it by base64 encoding it and using the base64 encoded string as part of a Data URI that you set as the src of an image:

echo "<img src=\"data:image/jpeg;base64," . base64_encode($photo) . "\" />"; 

This may not be best practise if the images are large. It's better to have a separate PHP script that returns the image based on an id, and then you can reference that script in the src field of the img tag. That way the browser can possibly cache it, and the server transmits less data (base64 encoding increases the size).

samgak
  • 23,944
  • 4
  • 60
  • 82