Skip to content

Commit

Permalink
cpymo-tool gen-album-cache will not overwrite file.
Browse files Browse the repository at this point in the history
  • Loading branch information
Seng-Jik committed Jun 30, 2023
1 parent 371ee80 commit e9d37be
Showing 1 changed file with 10 additions and 0 deletions.
10 changes: 10 additions & 0 deletions cpymo/cpymo_album.c
Original file line number Diff line number Diff line change
Expand Up @@ -167,6 +167,16 @@ error_t cpymo_album_generate_album_ui_image_pixels(
snprintf(page_str, sizeof(page_str), "%d", (int)page);
strcat(path, page_str);
strcat(path, ".png");

#ifdef CPYMO_TOOL
if (fopen(path, "rb"))
{
free(path);
*out_image = pixels;
return CPYMO_ERR_SUCC;
}
#endif

stbi_write_png(path, (int)*ref_w, (int)*ref_h, 3, pixels, (int)*ref_w * 3);
free(path);
}
Expand Down

0 comments on commit e9d37be

Please sign in to comment.