Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
O
our_own_cloud_project
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Wiki
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Deploy
Releases
Model registry
Monitor
Incidents
Analyze
Value stream analytics
Contributor analytics
Repository analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
die_coolen_jungs
our_own_cloud_project
Commits
9dbb07b8
Commit
9dbb07b8
authored
12 years ago
by
Thomas Tanghus
Browse files
Options
Downloads
Patches
Plain Diff
Added data() method to OC_Image to return raw image data.
parent
301a14dc
No related branches found
Branches containing commit
No related tags found
No related merge requests found
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
lib/image.php
+11
-4
11 additions, 4 deletions
lib/image.php
with
11 additions
and
4 deletions
lib/image.php
+
11
−
4
View file @
9dbb07b8
...
...
@@ -187,15 +187,22 @@ class OC_Image {
}
/**
* @returns Returns
a base64 encoded string suitable for embedding in a VCard
.
* @returns Returns
the raw image data
.
*/
function
__toString
()
{
function
data
()
{
ob_start
();
$res
=
imagepng
(
$this
->
resource
);
if
(
!
$res
)
{
OC_Log
::
write
(
'core'
,
'OC_Image->
__toString
. Error
wri
ting image'
,
OC_Log
::
ERROR
);
OC_Log
::
write
(
'core'
,
'OC_Image->
data
. Error
get
ting image
data.
'
,
OC_Log
::
ERROR
);
}
return
base64_encode
(
ob_get_clean
());
return
ob_get_clean
();
}
/**
* @returns Returns a base64 encoded string suitable for embedding in a VCard.
*/
function
__toString
()
{
return
base64_encode
(
$this
->
data
());
}
/**
...
...
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