PHP Alter Base64 Encoding of image

Ahmar Ali

I am developing an application and for that I need to generate multiple copies of same image with unique base 64 encoding.

However I am not sure that if I add a random string like "aasasa" in between my image code whether it will corrupt image or it will display properly?

Is there any way to achieve this?

    $imageDataEncoded = base64_encode(file_get_contents($_FILES["fileToUpload"]["tmp_name"]));

     $imageData = base64_decode($imageDataEncoded);
     $imageData="asasasas".$imageData;
     $source = imagecreatefromstring($imageData);

Thanks Ahmar

Dennis Eichhorn

It's not entirely obvious why you would want to do this (maybe there is a better way to achieve what you're after). Anyways, I would try and change the image metadata. By changing the metadata you are "not changing" the image itself.

Further reading material:

http://php.net/manual/en/book.exif.php

http://php.net/manual/en/function.iptcembed.php

http://www.sno.phy.queensu.ca/~phil/exiftool/TagNames/EXIF.html

This can be achieved by using a EXIF library, but be aware that these changes are obviously way more performance intensive and can slow down your load time significantly, especially if you do this on a lot of pages.

Collected from the Internet

Please contact [email protected] to delete if infringement.

edited at
0

Comments

0 comments
Login to comment

Related

From Dev

Cherrypy base64 image encoding not working as expected

From Dev

Image upload, resizing and encoding to base64 crashes Chrome on mobile

From Dev

How to post an image in base64 encoding via .ajax?

From Dev

Upload Image to server using base64 encoding android

From Dev

Encoding a image to base64 and upload to web service in Phonegap

From Dev

Cherrypy base64 image encoding not working as expected

From Dev

Image tags in MVC, path restrictions, base64 encoding

From Dev

Is data:image/png;base64 the only base64 encoding for the img tag?

From Dev

Base64 decode image PHP

From Dev

PHP: Convert base64 to image

From Dev

Issue with Encoding base64 in PHP and Decoding base64 in Java

From Dev

PHP Base64 encoding for JSON slash issue

From Dev

PHP RSA-public key base64 encoding

From Dev

PHP RSA-public key base64 encoding

From Dev

Swift - uploading base64 encoded image to php and displaying the image

From Dev

Add base64 image to another image in PHP

From Dev

Encoding special characters to Base64 in Javascript and decoding using base64_decode() in PHP

From Dev

Receiving an image via jQuery AJAX and displaying the image without the server base64 encoding the image

From Dev

Image quality changes while encoding/decoding image to base64 string

From Dev

How to use Base64 in PHP to post an image?

From Dev

Base64 image from IOS to php service

From Dev

PHP: get image from base64 string and store it in the path

From Dev

Sending huge base64 image to PHP via POST

From Dev

POST base64 encoded image string to PHP

From Dev

How to decode a base64 image and write to file using PHP

From Dev

Grabbing a php base64 image from angularJS

From Dev

Base64 image from IOS to php service

From Dev

Upload base64 image to php server and save to MySql

From Dev

HTTP, PHP: Return base64 image png as download

Related Related

  1. 1

    Cherrypy base64 image encoding not working as expected

  2. 2

    Image upload, resizing and encoding to base64 crashes Chrome on mobile

  3. 3

    How to post an image in base64 encoding via .ajax?

  4. 4

    Upload Image to server using base64 encoding android

  5. 5

    Encoding a image to base64 and upload to web service in Phonegap

  6. 6

    Cherrypy base64 image encoding not working as expected

  7. 7

    Image tags in MVC, path restrictions, base64 encoding

  8. 8

    Is data:image/png;base64 the only base64 encoding for the img tag?

  9. 9

    Base64 decode image PHP

  10. 10

    PHP: Convert base64 to image

  11. 11

    Issue with Encoding base64 in PHP and Decoding base64 in Java

  12. 12

    PHP Base64 encoding for JSON slash issue

  13. 13

    PHP RSA-public key base64 encoding

  14. 14

    PHP RSA-public key base64 encoding

  15. 15

    Swift - uploading base64 encoded image to php and displaying the image

  16. 16

    Add base64 image to another image in PHP

  17. 17

    Encoding special characters to Base64 in Javascript and decoding using base64_decode() in PHP

  18. 18

    Receiving an image via jQuery AJAX and displaying the image without the server base64 encoding the image

  19. 19

    Image quality changes while encoding/decoding image to base64 string

  20. 20

    How to use Base64 in PHP to post an image?

  21. 21

    Base64 image from IOS to php service

  22. 22

    PHP: get image from base64 string and store it in the path

  23. 23

    Sending huge base64 image to PHP via POST

  24. 24

    POST base64 encoded image string to PHP

  25. 25

    How to decode a base64 image and write to file using PHP

  26. 26

    Grabbing a php base64 image from angularJS

  27. 27

    Base64 image from IOS to php service

  28. 28

    Upload base64 image to php server and save to MySql

  29. 29

    HTTP, PHP: Return base64 image png as download

HotTag

Archive