f.Write(bytes, 1, (uint)size);
}
-static char * extensions[] = { "png", null };
+static const char * extensions[] = { "png", null };
class PNGFormat : BitmapFormat
{
bool Load(Bitmap bitmap, File f)
{
bool result = false;
+#if defined(__EMSCRIPTEN__)
+ PrintLn(" ------------------------------------- getting in here ------------------------------------- ");
+#endif
png_structp png_ptr = png_create_read_struct(PNG_LIBPNG_VER_STRING, null, null, null);
png_read_info(png_ptr, info_ptr);
channels = png_get_channels(png_ptr, info_ptr);
if(channels == 3 || channels == 4 || channels == 1 || channels == 2)
- {
+ {
png_get_IHDR(png_ptr, info_ptr, &width, &height, &bit_depth, &color_type,
&interlace_type, null, null);
numPasses = png_set_interlace_handling(png_ptr);
return result;
}
- bool Save(Bitmap bitmap, char *filename, void * options)
+ bool Save(Bitmap bitmap, const char *filename, void * options)
{
bool result = false;
Bitmap tempBitmap = null;
if(bitmap)
{
File f = FileOpen(filename, write);
- if(f)
+ if(f)
{
png_structp png_ptr = png_create_write_struct(PNG_LIBPNG_VER_STRING, null, null, null);
if(png_ptr)
return result;
}
- ColorAlpha * LoadPalette(char * fileName, char * type)
+ ColorAlpha * LoadPalette(const char * fileName, const char * type)
{
ColorAlpha * result = null;
return result;