Skip to content

Commit

Permalink
Adjust README
Browse files Browse the repository at this point in the history
  • Loading branch information
SimonScholz committed Nov 25, 2023
1 parent 42d9c04 commit 1d32475
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 2 deletions.
1 change: 1 addition & 0 deletions README.adoc
Expand Up @@ -292,6 +292,7 @@ The `qr-code-app` project is a simple Swing application, which uses this library
- Offers properties panel for the QR code design (colors, shapes, logo, etc.)
- Save the QR code as image
- Copy the QR code to the clipboard
- Copy the QR code as Base64 encoded string to the clipboard
- Save the QR code config/design to a file
- Load a QR code from a config/design file
- Copy sample code based on current config to the clipboard (Java or Kotlin)
Expand Down
@@ -1,6 +1,6 @@
package io.github.simonscholz.qrcode

import java.awt.image.BufferedImage
import java.awt.image.RenderedImage
import java.io.ByteArrayOutputStream
import javax.imageio.ImageIO
import kotlin.io.encoding.Base64
Expand All @@ -12,7 +12,7 @@ import kotlin.io.encoding.ExperimentalEncodingApi
* @return base64 encoded String
*/
@OptIn(ExperimentalEncodingApi::class)
fun BufferedImage.toBase64(): String =
fun RenderedImage.toBase64(): String =
ByteArrayOutputStream().use {
ImageIO.write(this, "png", it)
Base64.Default.encode(it.toByteArray())
Expand Down

0 comments on commit 1d32475

Please sign in to comment.