Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
D
dolibarr
Manage
Activity
Members
Code
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Deploy
Releases
Container registry
Model registry
Analyze
Contributor analytics
Repository analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
GitLab community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
Software_Artifact_Infrastructure_Repository
dolibarr
Commits
eebaff95
Commit
eebaff95
authored
7 years ago
by
Laurent Destailleur
Browse files
Options
Downloads
Patches
Plain Diff
Fix pb with imagick
parent
22ca29a5
Branches
main
No related tags found
No related merge requests found
Changes
2
Show whitespace changes
Inline
Side-by-side
Showing
2 changed files
htdocs/core/lib/files.lib.php
+19
-12
19 additions, 12 deletions
htdocs/core/lib/files.lib.php
htdocs/core/lib/functions.lib.php
+5
-2
5 additions, 2 deletions
htdocs/core/lib/functions.lib.php
with
24 additions
and
14 deletions
htdocs/core/lib/files.lib.php
+
19
−
12
View file @
eebaff95
...
@@ -1565,12 +1565,14 @@ function dol_remove_file_process($filenb,$donotupdatesession=0,$donotdeletefile=
...
@@ -1565,12 +1565,14 @@ function dol_remove_file_process($filenb,$donotupdatesession=0,$donotdeletefile=
* @param string $fileinput Input file name
* @param string $fileinput Input file name
* @param string $ext Format of target file (It is also extension added to file if fileoutput is not provided).
* @param string $ext Format of target file (It is also extension added to file if fileoutput is not provided).
* @param string $fileoutput Output filename
* @param string $fileoutput Output filename
* @return int <0 if KO, >0 if OK
* @return int <0 if KO,
0=Nothing done,
>0 if OK
*/
*/
function
dol_convert_file
(
$fileinput
,
$ext
=
'png'
,
$fileoutput
=
''
)
function
dol_convert_file
(
$fileinput
,
$ext
=
'png'
,
$fileoutput
=
''
)
{
{
global
$langs
;
global
$langs
;
if
(
class_exists
(
'Imagick'
))
{
$image
=
new
Imagick
();
$image
=
new
Imagick
();
$ret
=
$image
->
readImage
(
$fileinput
);
$ret
=
$image
->
readImage
(
$fileinput
);
if
(
$ret
)
if
(
$ret
)
...
@@ -1595,6 +1597,11 @@ function dol_convert_file($fileinput,$ext='png',$fileoutput='')
...
@@ -1595,6 +1597,11 @@ function dol_convert_file($fileinput,$ext='png',$fileoutput='')
return
-
1
;
return
-
1
;
}
}
}
}
else
{
return
0
;
}
}
/**
/**
...
...
This diff is collapsed.
Click to expand it.
htdocs/core/lib/functions.lib.php
+
5
−
2
View file @
eebaff95
...
@@ -1235,10 +1235,13 @@ function dol_banner_tab($object, $paramid, $morehtml='', $shownav=1, $fieldid='r
...
@@ -1235,10 +1235,13 @@ function dol_banner_tab($object, $paramid, $morehtml='', $shownav=1, $fieldid='r
if
(
(
!
file_exists
(
$fileimage
)
||
(
filemtime
(
$fileimage
)
<
filemtime
(
$file
)))
if
(
(
!
file_exists
(
$fileimage
)
||
(
filemtime
(
$fileimage
)
<
filemtime
(
$file
)))
&&
(
!
file_exists
(
$fileimagebis
)
||
(
filemtime
(
$fileimagebis
)
<
filemtime
(
$file
)))
&&
(
!
file_exists
(
$fileimagebis
)
||
(
filemtime
(
$fileimagebis
)
<
filemtime
(
$file
)))
)
)
{
if
(
empty
(
$conf
->
global
->
MAIN_DISABLE_PDF_THUMBS
))
// If you experienc trouble with pdf thumb generation and imagick, you can disable here.
{
{
$ret
=
dol_convert_file
(
$file
,
'png'
,
$fileimage
);
$ret
=
dol_convert_file
(
$file
,
'png'
,
$fileimage
);
if
(
$ret
<
0
)
$error
++
;
if
(
$ret
<
0
)
$error
++
;
}
}
}
$heightforphotref
=
70
;
$heightforphotref
=
70
;
if
(
!
empty
(
$conf
->
dol_optimize_smallscreen
))
$heightforphotref
=
60
;
if
(
!
empty
(
$conf
->
dol_optimize_smallscreen
))
$heightforphotref
=
60
;
...
...
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