Search code examples
imageqr-code

How to store an image inside a qr code content offline?


I want to store an image inside a QR code offline. When the user scans the QR code, the image will automatically show without any network connectivity. Is there a way to do this?


Solution

  • This is not possible.

    QR Code readers are made to decrypt text entries. The only way you have is to put a link in your QR Code which redirects to the image : and that needs connectivity.

    Even if you encode your image into data URI, the QR Code will be too big to be correctly read. QR codes are made to encapsulate about 250 characters. A data URI image's length is from about 10,000 to 1,000,000 characters.

    And even if it is correctly read (maybe if you used high ECC redondancy to encode it), there is nothing in the reader's application that can read a data URI image. Only a browser can, using CSS styling.

    QR Codes were created in a connected environment, to share links easily.

    Your only option is to host your image somewhere and then encode the URL inside your QR Code. Those are examples of image hoster :