|
|
|
|
@ -144,12 +144,12 @@ const write_resized = async (image_path, original) => {
|
|
|
|
|
return gm_write(image, image_path); |
|
|
|
|
}; |
|
|
|
|
|
|
|
|
|
const save_images = async (image = null, event_id) => { |
|
|
|
|
const save_images = async (image = null, event_id, image_directory) => { |
|
|
|
|
if (image === null) { |
|
|
|
|
return []; |
|
|
|
|
} |
|
|
|
|
const original_path = `./img/${event_id}.jpg`; |
|
|
|
|
const resized_path = `./img/${event_id}-square.jpg`; |
|
|
|
|
const original_path = `${image_directory}/${event_id}.jpg`; |
|
|
|
|
const resized_path = `${image_directory}/${event_id}-square.jpg`; |
|
|
|
|
const original = write_image(original_path, image); |
|
|
|
|
const resized_square = write_resized(resized_path, image); |
|
|
|
|
try { |
|
|
|
|
|