Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
A
auc
Manage
Activity
Members
Labels
Plan
Wiki
Custom issue tracker
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Locked files
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Model registry
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Code review analytics
Insights
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Terms and privacy
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
project
auc
Commits
23e2aa1a
Commit
23e2aa1a
authored
3 years ago
by
Mike Carper
Committed by
Michael Carper
3 years ago
Browse files
Options
Downloads
Patches
Plain Diff
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
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
auc.module
+5
-0
5 additions, 0 deletions
auc.module
auc.under_hood.inc
+6
-4
6 additions, 4 deletions
auc.under_hood.inc
with
11 additions
and
4 deletions
auc.module
+
5
−
0
View file @
23e2aa1a
...
...
@@ -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'
,
...
...
This diff is collapsed.
Click to expand it.
auc.under_hood.inc
+
6
−
4
View file @
23e2aa1a
...
...
@@ -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
),
));
}
}
...
...
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment