Skip to content
Snippets Groups Projects
Commit 23e2aa1a authored by Mike Carper's avatar Mike Carper Committed by Michael Carper
Browse files

Issue #3260705 by mikeytown2: add in bmp and comment out debugging code

parent 2897ee29
No related branches found
No related tags found
No related merge requests found
......@@ -28,6 +28,11 @@ function auc_init() {
'program' => 'imagemagick',
'command' => "%fn% -type optimize -quality 85% -strip 'jpg:%fn%'",
],
'bmp' => [
'extension' => 'jpg',
'program' => 'imagemagick',
'command' => "%fn% -type optimize -quality 85% -strip 'jpg:%fn%'",
],
'psd' => [
'extension' => 'jpg',
'program' => 'imagemagick',
......
......@@ -55,14 +55,14 @@ function auc_ext_check($path_parts, &$imagemagick_convert_checked) {
if (!is_uploaded_file($file_location)) {
continue;
}
$file_copies[] = file_unmanaged_copy($file_location, "public://thingy/{$file_name}");
// $file_copies[] = file_unmanaged_copy($file_location, "public://debug/{$file_name}");
}
}
if (!empty($_FILES['file']['name'])) {
$file_name = $_FILES['file']['name'];
$file_location = $_FILES['file']['tmp_name'];
if (is_uploaded_file($file_location)) {
$file_copies[] = file_unmanaged_copy($file_location, "public://thingy/{$file_name}");
// $file_copies[] = file_unmanaged_copy($file_location, "public://debug/{$file_name}");
}
}
......@@ -239,7 +239,8 @@ function auc_is_image_correct(stdClass $file): bool {
$placeholders['%bits'] = !empty($image_info['bits']) ? $image_info['bits'] : 'not defined';
if (!$is_correct) {
$file_copy = file_unmanaged_copy($file->uri, "public://thingy/{$file->filename}");
$file_copy = '';
// $file_copy = file_unmanaged_copy($file->uri, "public://debug/{$file->filename}");
$placeholders['@file_copy'] = print_r($file_copy, TRUE);
$message = 'Seems this image is broken. Filename: %filename, filepath: %filepath, channels: %channels, bits: %bits. <br><pre>@file</pre> <br><pre>@post</pre> <br><pre>@files</pre> <br><pre>@phpinput</pre> <br><pre>@server</pre> <br><pre>@file_copy</pre>';
watchdog('auc', $message, $placeholders, WATCHDOG_WARNING);
......@@ -388,8 +389,9 @@ function auc_process_wrapper($conversion_lut, $path_parts, string $field_name =
}
// Report success.
watchdog('auc', 'auto upload convert worked.<br>@command<br>', array(
watchdog('auc', 'auto upload convert worked. <br>@command<br> <pre>@debug</pre>', array(
'@command' => $command,
'@debug' => print_r([$field_name, $input_file_extension, $path_parts, $conversion_lut[$input_file_extension]], TRUE),
));
}
}
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment