Class ImageUtil

java.lang.Object
net.thevpc.naru.util.ImageUtil

public class ImageUtil extends Object
Utility helpers for image handling.
  • Method Details

    • toBase64

      public static String toBase64(String imagePath) throws IOException
      Reads an image file from disk and returns it as a Base64-encoded string (no data-URL prefix — just the raw base64 data that Ollama expects).
      Throws:
      IOException
    • mimeType

      public static String mimeType(String imagePath)
      Returns the MIME type based on file extension (best-effort).