Skip to content

Commit

Permalink
#370 allow not-so-correct image url of form "data:image;base64,iVBORw…
Browse files Browse the repository at this point in the history
…...."
  • Loading branch information
asolntsev committed Aug 26, 2024
1 parent 3aff0d0 commit babc4cb
Show file tree
Hide file tree
Showing 3 changed files with 39 additions and 2 deletions.
4 changes: 4 additions & 0 deletions .idea/inspectionProfiles/Project_Default.xml

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Original file line number Diff line number Diff line change
Expand Up @@ -255,7 +255,7 @@ public static BufferedImage createTransparentImage(int width, int height) {
*/
@CheckReturnValue
public static boolean isEmbeddedBase64Image(@Nullable String uri) {
return uri != null && uri.startsWith("data:image/");
return uri != null && uri.startsWith("data:image");
}

/**
Expand Down Expand Up @@ -301,7 +301,7 @@ public static BufferedImage loadEmbeddedBase64Image(String imageDataUri) {
private interface Scaler {
/**
* Convenience method that returns a scaled instance of the
* provided {@code BufferedImage}, taken from
* provided {@code BufferedImage}, taken from
* <a href="http://today.java.net/pub/a/today/2007/04/03/perils-of-image-getscaledinstance.html">article on java.net by Chris Campbell</a>.
* <br>
* Expects the image to be fully loaded (e.g. no need to wait for loading on requesting height or width)
Expand Down
Loading

0 comments on commit babc4cb

Please sign in to comment.