mirror of
https://github.com/koreader/koreader.git
synced 2025-08-10 00:52:38 +00:00
Slight tidy-up of the code.
This commit is contained in:
committed by
Qingping Hou
parent
cac63cd390
commit
7609fc2dd0
8
pic.c
8
pic.c
@@ -137,13 +137,11 @@ static int openDocument(lua_State *L) {
|
||||
doc->image = raw_image;
|
||||
else if (components == 3) {
|
||||
uint8_t *gray_image = rgbToGrayscale(raw_image, width, height);
|
||||
if (!gray_image) {
|
||||
free(raw_image);
|
||||
free(raw_image);
|
||||
if (!gray_image)
|
||||
return luaL_error(L, "Cannot convert to grayscale");
|
||||
} else {
|
||||
free(raw_image);
|
||||
else
|
||||
doc->image = gray_image;
|
||||
}
|
||||
} else
|
||||
return luaL_error(L, "Unsupported image format");
|
||||
|
||||
|
||||
Reference in New Issue
Block a user