Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
Feeds
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Container Registry
Model registry
Operate
Environments
Monitor
Incidents
Service Desk
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
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
TeDomum
Feeds
Commits
fd5dd27f
You need to sign in or sign up before continuing.
Commit
fd5dd27f
authored
4 years ago
by
Andrew Dolgov
Browse files
Options
Downloads
Plain Diff
Merge branch 'master' of git.tt-rss.org:fox/tt-rss into wip-config-object
parents
caf30403
ac6cea85
No related branches found
No related tags found
No related merge requests found
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
lib/jimIcon.php
+12
-5
12 additions, 5 deletions
lib/jimIcon.php
with
12 additions
and
5 deletions
lib/jimIcon.php
+
12
−
5
View file @
fd5dd27f
...
@@ -104,11 +104,11 @@ class jimIcon {
...
@@ -104,11 +104,11 @@ class jimIcon {
}
}
// See if we can parse it (might be PNG format here)
// See if we can parse it (might be PNG format here)
$i
=
@
imagecreatefromstring
(
$data
)
;
if
(
self
::
has_parsable_image_type
(
$data
)
)
{
if
(
$i
=
@
imagecreatefromstring
(
$data
))
{
if
(
$i
)
{
imagesavealpha
(
$i
,
true
);
imagesavealpha
(
$i
,
true
)
;
return
$i
;
return
$i
;
}
}
}
// Must be a BMP. Parse it ourselves.
// Must be a BMP. Parse it ourselves.
...
@@ -267,5 +267,12 @@ class jimIcon {
...
@@ -267,5 +267,12 @@ class jimIcon {
}
}
return
$img
;
return
$img
;
}
}
// Checks whether the data is a type parsable by imagecreatefromstring()
private
function
has_parsable_image_type
(
$image_data
)
{
$size
=
getimagesizefromstring
(
$image_data
);
return
$size
&&
in_array
(
$size
[
2
],
[
IMAGETYPE_JPEG
,
IMAGETYPE_PNG
,
IMAGETYPE_GIF
,
IMAGETYPE_BMP
,
IMAGETYPE_WBMP
,
IMAGETYPE_WEBP
]);
}
}
}
?>
?>
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