⚲
Project
General
Profile
Sign in
Home
Projects
Help
Search
:
TYPO3 Core
All Projects
TYPO3 Core
Overview
Activity
Roadmap
Issues
Repository
Download (1012 Bytes)
Bug #46020
» imagesize.php
Mathias Bolt Lesniak
, 2013-12-12 20:51
<?php
$conf
=
include
'LocalConfiguration.php'
;
$c
=
mysql_connect
(
$conf
[
'DB'
][
'host'
],
$conf
[
'DB'
][
'username'
],
$conf
[
'DB'
][
'password'
]
);
if
(
!
$c
)
{
die
(
'Could not connect: '
.
mysql_error
());
}
mysql_select_db
(
$conf
[
'DB'
][
'database'
]);
$sql
=
'SELECT * FROM sys_file WHERE width=0 AND height=0'
;
$result
=
mysql_query
(
$sql
);
if
(
!
$result
)
{
echo
"Could not successfully run query (
$sql
) from DB: "
.
mysql_error
();
exit
;
}
while
(
$row
=
mysql_fetch_assoc
(
$result
))
{
$filename
=
$row
[
'identifier'
];
if
(
$row
[
'storage'
]
==
1
)
{
$filename
=
'/fileadmin'
.
$filename
;
}
$filename
=
'..'
.
$filename
;
$mime
=
mime_content_type
(
$filename
);
list
(
$width
,
$height
)
=
getimagesize
(
$filename
);
$sql
=
'UPDATE sys_file SET mime_type = \''
.
$mime
.
'\', width = \''
.
$width
.
'\', height = \''
.
$height
.
'\' WHERE uid = '
.
$row
[
'uid'
];
$r
=
mysql_query
(
$sql
);
if
(
!
$r
)
{
echo
"Could not successfully run query (
$sql
) from DB: "
.
mysql_error
();
}
echo
$sql
.
"
\n\n
"
;
}
?>
« Previous
1
…
3
4
5
6
7
8
Next »
(5-5/8)
Loading...