Skip to content
GitLab
Projects
Groups
Snippets
Help
Loading...
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Sign in
Toggle navigation
D
drupal
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Locked Files
Custom Issue Tracker
Custom Issue Tracker
Labels
Merge Requests
300
Merge Requests
300
Requirements
Requirements
List
Security & Compliance
Security & Compliance
Dependency List
License Compliance
Analytics
Analytics
Code Review
Insights
Issue
Repository
Value Stream
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Commits
Open sidebar
project
drupal
Commits
9e637382
Commit
9e637382
authored
Jul 31, 2005
by
Dries
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
- Patch
#27431
by Cvbge: add file size infomation to image_get_info()
parent
6fdb939d
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
3 additions
and
0 deletions
+3
-0
includes/image.inc
includes/image.inc
+3
-0
No files found.
includes/image.inc
View file @
9e637382
...
...
@@ -78,6 +78,7 @@ function image_toolkit_invoke($method, $params = array()) {
* 'height': image's height in pixels
* 'extension': commonly used extension for the image
* 'mime_type': image's MIME type ('image/jpeg', 'image/gif', etc.)
* 'file_size': image's physical size (in bytes)
*/
function
image_get_info
(
$file
)
{
if
(
!
is_file
(
$file
))
{
...
...
@@ -86,6 +87,7 @@ function image_get_info($file) {
$details
=
false
;
$data
=
@
getimagesize
(
$file
);
$file_size
=
@
filesize
(
$file
);
if
(
is_array
(
$data
))
{
$extensions
=
array
(
'1'
=>
'gif'
,
'2'
=>
'jpg'
,
'3'
=>
'png'
);
...
...
@@ -93,6 +95,7 @@ function image_get_info($file) {
$details
=
array
(
'width'
=>
$data
[
0
],
'height'
=>
$data
[
1
],
'extension'
=>
$extension
,
'file_size'
=>
$file_size
,
'mime_type'
=>
$data
[
'mime'
]);
}
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment