This program is free software; you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
This program is free software; you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
boost::uintmax_t const size = boost::filesystem::file_size (path);
FILE* f = fopen_boost (path, "rb");
if (!f) {
throw OpenFileError (path);
}
boost::uintmax_t const size = boost::filesystem::file_size (path);
FILE* f = fopen_boost (path, "rb");
if (!f) {
throw OpenFileError (path);
}
uint8_t* data = new uint8_t[size];
if (fread (data, 1, size, f) != size) {
delete[] data;
throw ReadFileError (path);
}
uint8_t* data = new uint8_t[size];
if (fread (data, 1, size, f) != size) {
delete[] data;
throw ReadFileError (path);
}
/* Write line-by-line here as _image must be aligned, and write() cannot be told about strides */
uint8_t* p = _image->data()[0];
for (int i = 0; i < size.height; ++i) {
/* Write line-by-line here as _image must be aligned, and write() cannot be told about strides */
uint8_t* p = _image->data()[0];
for (int i = 0; i < size.height; ++i) {
magick_image->write (0, i, size.width, 1, "RGB", CharPixel, p);
p += _image->stride()[0];
}
delete magick_image;
magick_image->write (0, i, size.width, 1, "RGB", CharPixel, p);
p += _image->stride()[0];
}
delete magick_image;