Many changes just look at the new documentation and such
This commit is contained in:
+5
-4
@@ -65,7 +65,7 @@ ppm_load(const char* file, PPM* m_attr)
|
||||
}
|
||||
|
||||
int
|
||||
ppm_save(const unsigned int* buf, const PPM img)
|
||||
ppm_save(const unsigned int* buf, const PPM img, char* name)
|
||||
{
|
||||
if (!buf)
|
||||
{
|
||||
@@ -82,12 +82,12 @@ ppm_save(const unsigned int* buf, const PPM img)
|
||||
|
||||
if (img.fmt == '3')
|
||||
{
|
||||
fptr = fopen(img.name, "w");
|
||||
fptr = fopen(name, "w");
|
||||
}
|
||||
|
||||
if (img.fmt == '6')
|
||||
{
|
||||
fptr = fopen(img.name, "wb");
|
||||
fptr = fopen(name, "wb");
|
||||
}
|
||||
|
||||
if (!fptr)
|
||||
@@ -125,6 +125,7 @@ ppm_save(const unsigned int* buf, const PPM img)
|
||||
fclose(fptr);
|
||||
free(dst_buf);
|
||||
printf("Encode Done!\n");
|
||||
printf("Image: %s is saved.\n", name);
|
||||
return 1;
|
||||
}
|
||||
|
||||
@@ -209,7 +210,7 @@ transcode_to_ppm(JPEG* input, PPM* out)
|
||||
out->width = input->width;
|
||||
out->height = input->height;
|
||||
out->len = out->width * out->height;
|
||||
ppm_save(dst, *out);
|
||||
ppm_save(dst, *out, out->name);
|
||||
free(dst);
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user