4images Forum & Community
4images Modifications / Modifikationen => Mods & Plugins (Releases & Support) => Topic started by: fatman on December 27, 2002, 04:23:00 AM
-
I always want somebody make 4images to have exif support, at last, I write this MOD for show the EXIF info of the JPG file in the detail page. Originally, I wrote one was using the PHP built in function to read the data, however, I found the function in php 4.1 is not read all tag of exif and I did not want to make a php 4.2 installation. Finally, I find a php exif library call Exifer is for ver 0.1 & 0.2.
Now, for version 0.3, it use the php built in exif function, so you must have the php 4.2 or above and enable the exif option. I have add a function for choosing which exif field to display( actually, i only parse 2 sections(IFD0, EXIF) in exif header, other section seem unless for information) It work OK on my Canon D60 image file, but I did not have parse the MakerNote filed.
1. Create a file exif.php at "includes/exif.php" and the content is:
the first line of code (EXIF_CONTROL) is to control display all field or chosen field.
the second line of code (EXIF_FILTER) is to control which filed to display.
<?php
/*
4images EXIF MOD
Version : 0.3
Date: 2003-01-17
By: fatman (fatman_li@yahoo.com.hk)
*/
// true: enable the field filter
// false: disable the field filter
define('EXIF_CONTROL', true);
// add the field name for show in exif section
// remember the field name with the colon ":"
define('EXIF_FILTER', "
Model:
Orientation:
ExposureTime:
FNumber:
ISOSpeedRatings:
ExposureBiasValue:
MeteringMode:
Flash:
FocalLength:
ColorSpace:
");
function exif_filter_control() {
return EXIF_CONTROL;
}
function exif_filter($name) {
if (strpos(EXIF_FILTER, ($name . ":")) > 0) {
return true;
} else {
return false;
}
}
function exif_get_str_val($val) {
$val = (substr($val, 0, strpos($val, "/"))) / (substr($val, strpos($val, "/") + 1));
return $val;
}
function exif_parse_value($name, $val) {
switch($name) {
case "Orientation":
if($val==1) $val = "Normal";
if($val==2) $val = "Mirrored";
if($val==3) $val = "Upsidedown";
if($val==4) $val = "Upsidedown Mirrored";
if($val==5) $val = "90deg CW Mirrored";
if($val==6) $val = "90deg CCW";
if($val==7) $val = "90deg CCW Mirrored";
if($val==8) $val = "90deg CW";
break;
case "ResolutionUnit":
if($val==1) $val = "No Unit";
if($val==2) $val = "Inch";
if($val==3) $val = "Centimeter";
break;
case "YCbCrPositioning":
if($val==1) $val = "Pixel Array";
if($val==2) $val = "Datum Point";
break;
case "ExposureTime":
$val = $val . " seconds";
break;
case "FNumber":
$val = "F/" . exif_get_str_val($val);
break;
case "ExposureProgram":
if($val==1) $val = "Manual control";
if($val==2) $val = "Program normal";
if($val==3) $val = "Aperture priority";
if($val==4) $val = "Shutter priority";
if($val==5) $val = "Program creative(slow program)";
if($val==6) $val = "Program action(high-speed program)";
if($val==7) $val = "Portrait mode";
if($val==8) $val = "Landscape mode";
break;
case "ExifVersion":
$val = round($val / 100, 2);
break;
case "ComponentsConfiguration":
$val = bin2hex($val);
$val = str_replace("01","Y",$val);
$val = str_replace("02","Cb",$val);
$val = str_replace("03","Cr",$val);
$val = str_replace("04","R",$val);
$val = str_replace("05","G",$val);
$val = str_replace("06","B",$val);
$val = str_replace("00","",$val);
break;
case "CompressedBitsPerPixel":
$val = exif_get_str_val($val);
break;
case "ShutterSpeedValue":
$val = "1/" . round(pow(2, exif_get_str_val($val))) . " seconds";
break;
case "ApertureValue":
$val = "F/" . round(pow(sqrt(2), exif_get_str_val($val)),1);
break;
case "BrightnessValue ":
$val = exif_get_str_val($val);
break;
case "ExposureBiasValue":
if ((substr($val, 0, strpos($val, "/"))) == "0") {
$val = "0 Step";
} else {
$val = $val . " Step";
}
break;
case "MaxApertureValue":
$val = "F/" . round(pow(sqrt(2), exif_get_str_val($val)),1);
break;
case "SubjectDistance":
$val = exif_get_str_val($val) . " M";
break;
case "MeteringMode":
if($val==0) $val = "Unknown";
if($val==1) $val = "Average";
if($val==2) $val = "Center Weighted Average";
if($val==3) $val = "Spot";
if($val==4) $val = "Multi-spot";
if($val==5) $val = "Multi-segment";
if($val==6) $val = "Partial";
if($val==255) $val = "Other";
break;
case "LightSource":
if($val==0) $val = "Unknown";
if($val==1) $val = "Daylight";
if($val==2) $val = "Fluorescent";
if($val==3) $val = "Tungsten";
if($val==10) $val = "Flash";
if($val==17) $val = "Standard light A";
if($val==18) $val = "Standard light B";
if($val==19) $val = "Standard light C";
if($val==20) $val = "D55";
if($val==21) $val = "D65";
if($val==22) $val = "D75";
if($val==255) $val = "Other";
break;
case "Flash":
if($val==0) $val = "No Flash";
if($val==1) $val = "Flash fired";
if($val==5) $val = "Flash fired but strobe return light not detected";
if($val==7) $val = "Flash fired and strobe return light detected";
if($val==9) $val = "Undefined";
break;
case "FocalLength":
$val = exif_get_str_val($val) . " mm";
break;
case "FlashPixVersion":
$val = round($val / 100, 2);
break;
case "ColorSpace":
if($val==1) $val = "sRGB";
if($val=='65535') $val = "Uncalibrated";
break;
case "FocalPlaneXResolution":
$val = round(exif_get_str_val($val));
break;
case "FocalPlaneYResolution":
$val = round(exif_get_str_val($val));
break;
case "FocalPlaneResolutionUnit":
if($val==1) $val = "No Unit";
if($val==2) $val = "Inch";
if($val==3) $val = "Centimeter";
break;
case "SensingMethod":
if($val==2) $val = "1 chip color area sensor";
break;
case "FileSource":
$val = bin2hex($val);
if($val==0x03) $val = "Digital still camera";
break;
case "FileSource":
$val = bin2hex($val);
if($val==0x01) $val = "Directly photographed";
break;
}
return $val;
}
?>
2. Open "includes/functions.php" and add after:
if (!defined('ROOT_PATH')) {
die("Security violation");
}
this code:
include(ROOT_PATH.'includes/exif.php');
3. Open "includes/functions.php" and add after:
if ($detailed_view && isset($info['APP13'])) {
$iptc_array = get_iptc_info($info['APP13']);
$bgcounter = 0;
foreach ($iptc_array as $key => $val) {
$row_bg_number = ($bgcounter++ % 2 == 0) ? 1 : 2;
$site_template->register_vars(array(
"iptc_value" => $val,
"iptc_name" => $lang['iptc_'.$key],
"row_bg_number" => $row_bg_number
));
$iptc_info .= $site_template->parse_template("iptc_bit");
}
}
this code:
$exif_info = "";
if ($image_info[2] == 2 && $detailed_view && !is_remote($media_file_name)) {
$exif = exif_read_data ($media_src,'IFD0');
$bgcounter = 0;
if ($exif) {
$exif = exif_read_data ($media_src,0,true);
foreach($exif as $key=>$section) {
if (($key == "IFD0") || ($key == "EXIF")) {
foreach($section as $name=>$val) {
if (!(exif_filter($name)) && exif_filter_control()) continue;
$row_bg_number = ($bgcounter++ % 2 == 0) ? 1 : 2;
$site_template->register_vars(array(
"exif_value" => exif_parse_value($name, $val),
"exif_name" => $name . ":",
"row_bg_number" => $row_bg_number
));
$exif_info .= $site_template->parse_template("exif_bit");
}
}
}
}
}
4. Open "includes/functions.php" and find:
$site_template->register_vars(array(
"media_src" => $media_src,
"media_icon" => $media_icon,
"image_name" => $image_name,
"width_height" => $width_height,
"width" => $width,
"height" => $height,
"iptc_info" => $iptc_info
));
replace with:
$site_template->register_vars(array(
"media_src" => $media_src,
"media_icon" => $media_icon,
"image_name" => $image_name,
"width_height" => $width_height,
"width" => $width,
"height" => $height,
"iptc_info" => $iptc_info,
"exif_info" => $exif_info
));
5. Open template detail.html and add after:
{if iptc_info}
<br />
<table width="100%" border="0" cellspacing="0" cellpadding="1">
<tr>
<td class="bordercolor">
<table width="100%" border="0" cellpadding="3" cellspacing="0">
<tr>
<td class="head1" valign="top" colspan="2">IPTC Info</td>
</tr>
{iptc_info}
</table>
</td>
</tr>
</table>
{endif iptc_info}
this code
{if exif_info}
<br />
<table width="100%" border="0" cellspacing="0" cellpadding="1">
<tr>
<td class="bordercolor">
<table width="100%" border="0" cellpadding="3" cellspacing="0">
<tr>
<td class="head1" valign="top" colspan="2">EXIF Info</td>
</tr>
{exif_info}
</table>
</td>
</tr>
</table>
{endif exif_info}
6. Create a new template exif_bit.html
<tr>
<td valign="top" class="row{row_bg_number}"><b>{exif_name}</b></td>
<td valign="top" class="row{row_bg_number}">{exif_value}</td>
</tr>
-
How about [ descript.ion ] in ACDsee, can we use this for read all the tags too. ( just wonder ???)
-
I dont see any difference between v0.1 and v0.2, its shows exact same info, no new field and same funny ceracters in MakerNote, even though when I checked that picture at the site it showed me clear text info...
then I deleted include('exif.php');
to check if the script give any erorros - and still it print EXIF information...well, I have PHP v4.2.3, maybe it uses only build in EXIF_INFO...
-
How about [ descript.ion ] in ACDsee, can we use this for read all the tags too. ( just wonder ???)
I don't use ACDsee, so I don't know.
-
I dont see any difference between v0.1 and v0.2, its shows exact same info, no new field and same funny ceracters in MakerNote, even though when I checked that picture at the site it showed me clear text info...
then I deleted include('exif.php');
to check if the script give any erorros - and still it print EXIF information...well, I have PHP v4.2.3, maybe it uses only build in EXIF_INFO...
then, it may because you have not modified following code.
it use different function call, it should be error if remark the include line.
3. Open "includes/functions.php" and add after:
if ($detailed_view && isset($info['APP13'])) {
$iptc_array = get_iptc_info($info['APP13']);
$bgcounter = 0;
foreach ($iptc_array as $key => $val) {
$row_bg_number = ($bgcounter++ % 2 == 0) ? 1 : 2;
$site_template->register_vars(array(
"iptc_value" => $val,
"iptc_name" => $lang['iptc_'.$key],
"row_bg_number" => $row_bg_number
));
$iptc_info .= $site_template->parse_template("iptc_bit");
}
}
this code:
$exif_info = "";
if (($file_extension == "jpg") || ($file_extension == "jpeg")) {
$exif = read_exif_data_raw($media_src,0);
$bgcounter = 0;
if ($exif > "") {
foreach($exif as $key=>$section) {
if (is_array($section)) {
foreach($section as $name=>$val) {
$row_bg_number = ($bgcounter++ % 2 == 0) ? 1 : 2;
$site_template->register_vars(array(
"exif_value" => ((is_array($val)) ? "" : $val),
"exif_name" => $name . ":",
"row_bg_number" => $row_bg_number
));
$exif_info .= $site_template->parse_template("exif_bit");
if (is_array($val)) {
foreach($val as $s_name=>$s_val) {
$site_template->register_vars(array(
"exif_value" => $s_val,
"exif_name" => " - " . $s_name . ":",
"row_bg_number" => $row_bg_number
));
$exif_info .= $site_template->parse_template("exif_bit");
}
}
}
}
}
}
I have get one of the image from your homepage and put to my server for testing.(I will delete it later), you can take a look.
http://come.no-ip.com/details.php?image_id=1315
http://photo.nixrex.com/details.php?image_id=233
-
Sry, my bad...was changing in one 4images code and tested on another one.... :oops:
but, now I get blank screen and phperor.log shows me this error:
[27-Dec-2002 11:05:10] PHP Parse error: parse error, unexpected $ in e:\www\4images\includes\functions.php on line 1280
[27-Dec-2002 11:05:10] PHP Fatal error: Call to undefined function: get_category_dropdown() in e:\www\4images\includes\page_header.php on line 132
on line 1280 in functions.php is " ?> "
in page_header.php on line 132 is "$category_dropdown_selfjump = get_category_dropdown($cat_id, 1);"
if I leave include and put code from v0.1 it works fine.
my spec:
WindowsXP, Apache 1.3.26, PHP 4.2.3, MySQL 3.23.52
-
Oh!!! I miss one "}"
there should be seven "}" at the end
$exif_info .= $site_template->parse_template("exif_bit");
}
}
}
}
}
}
}
-
hmm....strange, well, got it work, but it doesnt show as much as on your site:
http://come.no-ip.com/details.php?image_id=1315
-
should be some program error..
the last field is "unknown::", it got two colons. Normally, it should only got one ":" per field, there may be some looping problem.
Any other have tried it and succeed?
-
This worked great for me and did exactly what I wanted. Thanks!
I do want to note that I had to change the includes statements to have more of a path with them (I just found a different includes statement and copied the first part of it). Then, everything worked perfectly!
-
I had to turn this feature off, because now my phperror.log full of this:
[06-Jan-2003 04:19:33] PHP Warning: Invalid TIFF start (1) in e:\www\includes\functions.php on line 425
[06-Jan-2003 05:03:35] PHP Warning: Incorrect APP1 Exif Identifier Code in e:\www\includes\functions.php on line 425
it was on some images, but then I used "EXIFER" that I downloaded from www.download.com and now I get those errors for each picture...
-
Size: 16
Identifier: JFIF
ExtensionCode: 01
Data: HH
ImageDescription: Green Bay Packers vs. Detroit Lions
Make: Canon
Model: Canon EOS D60
Orientation: 65536
xResolution: 0.013888888888889
yResolution: 0.013888888888889
ResolutionUnit: 131072
Software: Adobe Photoshop 7.0
DateTime: 2003:01:12 22:04:02
Copyright: Copyright © 2002 Jennifer L. Richards
ExifOffset: 296
ExposureTime: 750 sec
FNumber: f 0.17857142857143
ExposureProgram: Unknown: 196608
ISOSpeedRatings: 52428800
ExifVersion: version 0
DateTimeOriginal: 2002:11:10 14:34:30
DateTimedigitized: 2002:11:10 14:34:30
ExposureBiasValue: 1000/0 EV
MeteringMode: Unknown: 327680
LightSource: Unknown
Flash: No Flash
FocalLength: 0.0033333333333333 mm
UserComment: ASCII
ColorSpace: Uncalibrated
ExifImageWidth: 562 pixels
ExifImageHeight: 640 pixels
Compression: Unknown: 393216
xResolution: 0.013888888888889
yResolution: 0.013888888888889
ResolutionUnit: 131072
JpegIFOffset: 926
JpegIFByteCount: 6199
Some of the fields seem to work, but some don't. I am particularily concerned with ISO, Aperature/Fnumber, and Shutter Speed. If you go to www.jenrichardsphotography.com you can see the problem on any image you select. I also tried uploading an image on your site, ran it through your EXIFER and the info is wrong there too. I have looked at the code and can't find the problem. Also, do you have any plans to parse out the MakerNote fields for Canon? I was going to try to do it myself, but can't quite get a handle on how the IFD tags work. Lastly, is there a way to display only certain EXIF fields on the detail page instead of all of them?
-
I am also using the D60, but I don't have your problem....
You may take a look on
http://photo.nixrex.com/details.php?image_id=182
Which version of firmware you are using? are you using the RAW format?
Anyway, I am tring to make the EXIF MOD to use PHP 4.2 built in functions
rather than the exifer. After this, I will try to write the EXIF field display control.
Some of the fields seem to work, but some don't. I am particularily concerned with ISO, Aperature/Fnumber, and Shutter Speed. If you go to www.jenrichardsphotography.com you can see the problem on any image you select. I also tried uploading an image on your site, ran it through your EXIFER and the info is wrong there too. I have looked at the code and can't find the problem. Also, do you have any plans to parse out the MakerNote fields for Canon? I was going to try to do it myself, but can't quite get a handle on how the IFD tags work. Lastly, is there a way to display only certain EXIF fields on the detail page instead of all of them?
-
I have modified one line of code of PART 3, it should improve the performance when listing the thumbnail.
from
if (($file_extension == "jpg") || ($file_extension == "jpeg")) {
to
if ((($file_extension == "jpg") || ($file_extension == "jpeg")) && ($detailed_view)) {
-
I do shoot in raw CRW format, then convert to TIF, and then JPG. Do you? Perhaps my data is getting corrupted along the way, although I thought I tried them with other EXIF readers and everthing is fine. I might have only tried the TIFs and not JPGs, so will have to verify that. Thanks for letting me check out your website.
-
I have make a update version 0.3 which use php exif function.
You may have a trial. I have tried to upload one of your image, seem that it is OK on the ISO, aperture...
-
I probably do something wrong, but it doesnt display anything now....it's like in output no information to display...
-
I have try your site image, also got your error even by the PHP built-in function of 0.3 ....
I probably do something wrong, but it doesnt display anything now....it's like in output no information to display...
-
I tried installing the new version, but couldn't get it to work. I got a parse error on line 2 of functions.php, a bunch of the usual header errors, and then a category_dropdown function not found error. I checked for spaces at the end of the php code in case that was causing the header errors, but that wasn't the problem. I couldn't find my problem, so I put it back to the old version.
From version 0.2 to 0.3, the only things that need to change are replacing the exif.php file and changing the exif section of functions.php. The rest of the code changes look the same as the prior version. Is this correct?
-
yes. only the exif.php and functions.php changed.
error... maybe the "}" in functions, it is quite easy to del all "}" if change from 0.2 to 0.3.
I list the whole function in functions.php
function get_media_code($media_file_name, $image_id = 0, $cat_id = 0, $image_name = "", $mode = "", $show_link = 0, $detailed_view = 0) {
global $site_template, $site_sess, $lang, $mode;
if (!get_file_path($media_file_name, "media", $cat_id, 0, 0)) {
$media = "<img src=\"".ICON_PATH."/404.gif\" border=\"0\" alt=\"\" />";
$site_template->register_vars("iptc_info", "");
}
else {
$media_src = get_file_path($media_file_name, "media", $cat_id, 0, 1);
$file_extension = get_file_extension($media_file_name);
$media_icon = "<img src=\"".ICON_PATH."/".$file_extension.".gif\" border=\"0\" alt=\"".$image_name."\" />";
if ($show_link) {
$media_icon = "<a href=\"".$site_sess->url(ROOT_PATH."details.php?".URL_IMAGE_ID."=".$image_id.((!empty($mode)) ? "&mode=".$mode : ""))."\">".$media_icon."</a>";
}
$width_height = "";
$width = "";
$height = "";
$iptc_info = "";
$src = (!file_exists($media_src) && file_exists(preg_replace("/\/{2,}/", "/", get_document_root()."/".$media_src))) ? preg_replace("/\/{2,}/", "/", get_document_root()."/".$media_src) : $media_src;
if ($image_info = @getimagesize($src, $info)) {
$width_height = " ".$image_info[3];
$width = $image_info[0];
$height = $image_info[1];
if ($detailed_view && isset($info['APP13'])) {
$iptc_array = get_iptc_info($info['APP13']);
$bgcounter = 0;
foreach ($iptc_array as $key => $val) {
$row_bg_number = ($bgcounter++ % 2 == 0) ? 1 : 2;
$site_template->register_vars(array(
"iptc_value" => $val,
"iptc_name" => $lang['iptc_'.$key],
"row_bg_number" => $row_bg_number
));
$iptc_info .= $site_template->parse_template("iptc_bit");
}
}
$exif_info = "";
if ($detailed_view) {
$exif = exif_read_data ($media_src,'IFD0');
$bgcounter = 0;
if ($exif) {
$exif = exif_read_data ($media_src,0,true);
foreach($exif as $key=>$section) {
if (($key == "IFD0") || ($key == "EXIF")) {
foreach($section as $name=>$val) {
if (!(exif_filter($name)) && exif_filter_control()) continue;
$row_bg_number = ($bgcounter++ % 2 == 0) ? 1 : 2;
$site_template->register_vars(array(
"exif_value" => exif_parse_value($name, $val),
"exif_name" => $name . ":",
"row_bg_number" => $row_bg_number
));
$exif_info .= $site_template->parse_template("exif_bit");
}
}
}
}
}
}
$site_template->register_vars(array(
"media_src" => $media_src,
"media_icon" => $media_icon,
"image_name" => $image_name,
"width_height" => $width_height,
"width" => $width,
"height" => $height,
"iptc_info" => $iptc_info,
"exif_info" => $exif_info
));
$media = $site_template->parse_template("media/".$file_extension);
}
return $media;
}
-
I probably do something wrong, but it doesnt display anything now....it's like in output no information to display...
sry, I figure what was wrong - my images.... :?
after I edit them with that exifer program something really messed up in the pictures, some even got white dots...
hopefuly that program has backup/restore features now everything works fine.
the only thing I'd suggest add to this mod is checking that the picture is jpg, jpeg as in previous version, atherwise in phperror.log get errors.
-
Parse error: parse error in /home/jenricha/public_html/4images/includes/functions.php on line 2
Warning: Cannot add header information - headers already sent by (output started at /home/jenricha/public_html/4images/includes/functions.php:2) in /home/jenricha/public_html/4images/includes/sessions.php on line 85
Warning: Cannot add header information - headers already sent by (output started at /home/jenricha/public_html/4images/includes/functions.php:2) in /home/jenricha/public_html/4images/includes/sessions.php on line 85
Warning: Cannot add header information - headers already sent by (output started at /home/jenricha/public_html/4images/includes/functions.php:2) in /home/jenricha/public_html/4images/includes/sessions.php on line 85
Warning: Cannot add header information - headers already sent by (output started at /home/jenricha/public_html/4images/includes/functions.php:2) in /home/jenricha/public_html/4images/includes/sessions.php on line 85
Fatal error: Call to undefined function: get_category_dropdown() in /home/jenricha/public_html/4images/includes/page_header.php on line 132
I cut and pasted the get_media_code section above and replaced it in my currently working functions.php. I replaced my exif.php with the new one. I still get the errors above. Not sure what the problem is. Thanks for all your help so far.
-
"headers already sent" usualy gets when something is after " ?> " at the end of php file. check again your new exif.php file.
and make sure that u put exif.php in /includes/ folder
-
Done. just modified
if ($detailed_view) {
to
if ((($file_extension == "jpg") || ($file_extension == "jpeg")) &&($detailed_view)) {
I am thinking to parse the MakerNote, the PHP exif function can't do this.
It is quite a lot info about shooting in this.
only thing I'd suggest add to this mod is checking that the picture is jpg, jpeg as in previous version, atherwise in phperror.log get errors.
-
Thanks V@no. I have already checked for the spaces at the end of the file thinking that might be the problem as well. I took my working functions.php file and just replaced the get_media_code section fatman put above and that is it. I also replaced my exif.php file with the new one. I didn't change anything else and the version 0.2 works OK for me. The parse error seems to be on the very first IF statement of functions.php, which hasn't changed, so I can't quite figure it out.
-
make sure u didnt miss this step of installation:
2. Open "includes/functions.php" and add after:
if (!defined('ROOT_PATH')) {
die("Security violation");
}
this code:
include('exif.php');
-
....
you can try my functions.php & exif.php, it is 1.7 only with the exif mod.
http://photo.nixrex.com/exif.zip
-
Fatal error: Call to undefined function: exif_read_data() in /home/jenricha/public_html/4images/includes/functions.php on line 388
Fatman, thank you for all your help so far. Your files fix my other error (I think I saved it as rich text instead of regular which screwed me up), but now when I go to the detail page I get the error above. I looked in both function.php and exif.php and can't find any function called exif_read_data. In your original instructions, you mention that you must have PHP 4.2 (I have 4.23) and enable exif.
Now, for version 0.3, it use the php built in exif function, so you must have the php 4.2 or above and enable the exif option
I wasn't sure what the enable exif part meant. I am thinking that might be my problem now. Any thoughts? Again, thank you so much for this mod and all your help.
-
the "--enable-exif " have to do when compile the PHP, or download a binary or RPM at http://www.aucs.org/rpmcenter/ have enable it.
you can find your PHP enable or not by phpinfo().
-
Thanks. I did actually research it and come to the same conclusion last night. I put in a request to my web host and it actually seems like they may recompile for me with the exif enabled. I am keeping my fingers crossed.
-
Hallo, so wie ich das nun verstanden habe ist dieser Exif - Mod nur mit php 4.2 möglich.
Leider habe ich erst nach der Installation bemerkt das mein Webhost nur php 4.1 drauf hat :(
Gibt es denn keine andere Möglichkeit?
Gruß, Michael
-
I used your exif.php & functions.php (I download zip file from your site) I used them and get this error:
Warning: Failed opening 'exif.php' for inclusion (include_path='') in /home/user23/public_html/includes/functions.php on line 29
I correct this error adding complete URL to include line... so this:
include('http://www.mydomain.com/includes/exif.php');
But when I enter to any photo details:
Fatal error: Call to undefined function: exif_filter() in /home/user23/public_html/includes/functions.php on line 396
What is wrong? Thanks
-
I did this mod and got :
Fatal error: Call to undefined function: exif_read_data() ***/includes/functions.php on line 420
so i made sure EXIF was enabled with my host they installed it for me @
/***/**/jhead
What do I do to make the script to look there
Thanks
Steve
-
try to use this include if you got path errors.
include(ROOT_PATH.'includes/exif.php');
to check do you have exif enable.
write a test.php with
<?php
phpinfo();
?>
load this page, you can find a lot configure command, such as
'./configure' 'i386-redhat-linux' '--prefix=/usr' '--exec-prefix=/usr' '--bindir=/usr/bin' '--sbindir=/usr/sbin' '--sysconfdir=/etc' '--datadir=/usr/share' '--includedir=/usr/include' '--libdir=/usr/lib' '--libexecdir=/usr/libexec' '--localstatedir=/var' '--sharedstatedir=/usr/com' '--mandir=/usr/share/man' '--infodir=/usr/share/info' '--prefix=/usr' '--with-config-file-path=/etc' '--enable-force-cgi-redirect' '--disable-debug' '--enable-pic' '--disable-rpath' '--enable-inline-optimization' '--with-bz2' '--with-db3' '--with-curl' '--with-dom=/usr' '--with-exec-dir=/usr/bin' '--with-freetype-dir=/usr' '--with-png-dir=/usr' '--with-gd' '--enable-gd-native-ttf' '--with-ttf' '--with-gdbm' '--with-gettext' '--with-ncurses' '--with-gmp' '--with-iconv' '--with-jpeg-dir=/usr' '--with-mm' '--with-openssl' '--with-png' '--with-pspell' '--with-regex=system' '--with-xml' '--with-expat-dir=/usr' '--with-zlib' '--with-layout=GNU' '--enable-bcmath' '--enable-debugger' '--enable-exif' '--enable-ftp' '--enable-magic-quotes' '--enable-safe-mode' '--enable-sockets' '--enable-sysvsem' '--enable-sysvshm' '--enable-discard-path' '--enable-track-vars' '--enable-trans-sid' '--enable-yp' '--enable-wddx' '--without-oci8' '--with-imap=shared' '--with-imap-ssl' '--with-kerberos=/usr/kerberos' '--with-ldap=shared' '--with-mysql=shared,/usr' '--with-pgsql=shared' '--with-snmp=shared,/usr' '--with-snmp=shared' '--enable-ucd-snmp-hack' '--with-unixODBC=shared' '--enable-memory-limit' '--enable-bcmath' '--enable-shmop' '--enable-versioning' '--enable-calendar' '--enable-dbx' '--enable-dio' '--enable-mbstring' '--with-apxs=/usr/sbin/apxs'
check --enable-exif is one if them
-
Thanks
I did that and its not in there. Ive emailed my host to tell them they havnt done it right :roll:
Thanks
Steve
-
Thanks the problem was with the path, all works fine!
One Question: Which is the file that I have to modify to translate Exif data to another language? P.E.: "ExposureTime" to "Tiempo de Exposicion" (in spanish).
Thanks :)
-
there is no way in current version. I may implement language file later... but should not be next version.
My to-do list in mind.
0.4 : Parse maker note (Canon first... of course)
0.5 : Language for EXIF tag
Thanks the problem was with the path, all works fine!
One Question: Which is the file that I have to modify to translate Exif data to another language? P.E.: "ExposureTime" to "Tiempo de Exposicion" (in spanish).
Thanks :)
-
Ok, thanks! We will wait with impatience :wink:
-
Da mein Englisch miserabel ist, bräuchte ich mal einen Übersetzter!
Ich habe mein Php info aufgerufen und es zeigt mir an das Exif auf enable steht, leider hat mein Webhost nur PHP 4.1 drauf und wird dieses erstmal auch nicht ändern. Kann man das nicht irgendwie trotz PHP 4.1 zum laufen bekommen? :?:
-
I've tried to use ShutterSpeedValue instead ExposureTime filter in exif.php, but it doesn't work: The Shutter Speed Value doesn't appear in exif info table.
This is the code that I got in exif.php
(...)
define('EXIF_FILTER', "
Make:
Model:
ShutterSpeedValue:
FNumber:
ISOSpeedRatings:
MeteringMode:
Flash:
FocalLength:
");
(...)
What is happening?
-
I am OK if change to ShutterSpeedValue: ...
Do your jpeg got ShutterSpeedValue when set the
define('EXIF_CONTROL', false); ?
I've tried to use ShutterSpeedValue instead ExposureTime filter in exif.php, but it doesn't work: The Shutter Speed Value doesn't appear in exif info table.
This is the code that I got in exif.php
(...)
define('EXIF_FILTER', "
Make:
Model:
ShutterSpeedValue:
FNumber:
ISOSpeedRatings:
MeteringMode:
Flash:
FocalLength:
");
(...)
What is happening?
-
I am OK if change to ShutterSpeedValue: ...
Do your jpeg got ShutterSpeedValue when set the
define('EXIF_CONTROL', false); ?
You're right, my camera gots ShutterSpeedValue (it's canon) but I've checked the value with a Nikon image :S
Sorry!
-
dear fatman
i got some error code like this
Warning: exif_read_data(0002.jpg) [exif_read_data]: process tag(x000D=UndefinedTa): Illegal pointer offset(x05C8 + x0044 = x060C > x05EF) in /home/ezbbs/public_html/photo/includes/functions.php on line 389
Warning: exif_read_data(0002.jpg) [exif_read_data]: process tag(x000D=UndefinedTa): Illegal pointer offset(x05C8 + x0044 = x060C > x05EF) in /home/ezbbs/public_html/photo/includes/functions.php on line 392
my photo is photo by Canon PowerShot G3 , others are work fine
can you tell me why ?
-
My web host will not recompile with EXIF enabled. When you came out with 0.3, instead of a new thread, you deleted the 0.2 code and replaced it with 0.3. Since I cannot use 0.3, could you repost the 0.2 code somewhere? Thanks.
-
Okay, thanks for the great mod. It works when I borrowed one of your images to test it out.
My question is not so much mod related by exif related.
I notice that my originals have the exif information, but if I open them in Paint shop pro 7.x and just resize them, the exif information is gone.
Since our site doesnt accept photos larger than 1/2 MB, people need to resize their images, but they are losing the exif information. Do you know how to keep it using Photoshop or Paintshop Pro?
-
I know exif is working, it works fine with my other image gallery software.... However I can't get it working with this:
Parse error: parse error, unexpected $ in /home/nfanatic/public_html/photos/includes/functions.php on line 1244
But what I don't understand is you say post after
}
}
But there are 3 of those after IPTC in functions.php... did you forget or does it go in between? I've tried them all. Nothing works....
What can't somebody just post functions.php to make it easy? Why does it have to be hard. Post functions.php and exif.php please.
the person who posted them earlier is now 404... :evil:
-
EXIF.PHP
<?php
/*
4images EXIF MOD
Version : 0.3
Date: 2003-01-17
By: fatman (fatman_li@yahoo.com.hk)
*/
// true: enable the field filter
// false: disable the field filter
define('EXIF_CONTROL', true);
// add the field name for show in exif section
// remember the field name with the colon ":"
define('EXIF_FILTER', "
Make:
Model:
DateTime:
Orientation:
ExposureTime:
FNumber:
ShutterSpeedValue:
ISOSpeedRatings:
ExposureBiasValue:
MeteringMode:
Flash:
FocalLength:
ColorSpace:
WhiteBalance:
DigitalZoomRatio:
");
function exif_filter_control() {
return EXIF_CONTROL;
}
function exif_filter($name) {
if (strpos(EXIF_FILTER, ($name . ":")) > 0) {
return true;
} else {
return false;
}
}
function exif_get_str_val($val) {
$val = (substr($val, 0, strpos($val, "/"))) / (substr($val, strpos($val, "/") + 1));
return $val;
}
function exif_parse_value($name, $val) {
switch($name) {
case "Orientation":
if($val==1) $val = "Normal";
if($val==2) $val = "Mirrored";
if($val==3) $val = "Upsidedown";
if($val==4) $val = "Upsidedown Mirrored";
if($val==5) $val = "90deg CW Mirrored";
if($val==6) $val = "90deg CCW";
if($val==7) $val = "90deg CCW Mirrored";
if($val==8) $val = "90deg CW";
break;
case "ResolutionUnit":
if($val==1) $val = "No Unit";
if($val==2) $val = "Inch";
if($val==3) $val = "Centimeter";
break;
case "YCbCrPositioning":
if($val==1) $val = "Pixel Array";
if($val==2) $val = "Datum Point";
break;
case "ExposureTime":
$val = $val . " seconds";
break;
case "FNumber":
$val = "F/" . exif_get_str_val($val);
break;
case "ExposureProgram":
if($val==1) $val = "Manual control";
if($val==2) $val = "Program normal";
if($val==3) $val = "Aperture priority";
if($val==4) $val = "Shutter priority";
if($val==5) $val = "Program creative(slow program)";
if($val==6) $val = "Program action(high-speed program)";
if($val==7) $val = "Portrait mode";
if($val==8) $val = "Landscape mode";
break;
case "ExifVersion":
$val = round($val / 100, 2);
break;
case "ComponentsConfiguration":
$val = bin2hex($val);
$val = str_replace("01","Y",$val);
$val = str_replace("02","Cb",$val);
$val = str_replace("03","Cr",$val);
$val = str_replace("04","R",$val);
$val = str_replace("05","G",$val);
$val = str_replace("06","B",$val);
$val = str_replace("00","",$val);
break;
case "CompressedBitsPerPixel":
$val = exif_get_str_val($val);
break;
case "ShutterSpeedValue":
$val = "1/" . round(pow(2, exif_get_str_val($val))) . " seconds";
break;
case "ApertureValue":
$val = "F/" . round(pow(sqrt(2), exif_get_str_val($val)),1);
break;
case "BrightnessValue ":
$val = exif_get_str_val($val);
break;
case "ExposureBiasValue":
if ((substr($val, 0, strpos($val, "/"))) == "0") {
$val = "0 Step";
} else {
$val = $val . " Step";
}
break;
case "MaxApertureValue":
$val = "F/" . round(pow(sqrt(2), exif_get_str_val($val)),1);
break;
case "SubjectDistance":
$val = exif_get_str_val($val) . " M";
break;
case "MeteringMode":
if($val==0) $val = "Unknown";
if($val==1) $val = "Average";
if($val==2) $val = "Center Weighted Average";
if($val==3) $val = "Spot";
if($val==4) $val = "Multi-spot";
if($val==5) $val = "Multi-segment";
if($val==6) $val = "Partial";
if($val==255) $val = "Other";
break;
case "LightSource":
if($val==0) $val = "Unknown";
if($val==1) $val = "Daylight";
if($val==2) $val = "Fluorescent";
if($val==3) $val = "Tungsten";
if($val==10) $val = "Flash";
if($val==17) $val = "Standard light A";
if($val==18) $val = "Standard light B";
if($val==19) $val = "Standard light C";
if($val==20) $val = "D55";
if($val==21) $val = "D65";
if($val==22) $val = "D75";
if($val==255) $val = "Other";
break;
case "Flash":
if($val==0) $val = "No Flash";
if($val==1) $val = "Flash fired";
if($val==5) $val = "Flash fired but strobe return light not detected";
if($val==7) $val = "Flash fired and strobe return light detected";
if($val==9) $val = "Undefined";
break;
case "FocalLength":
$val = exif_get_str_val($val) . " mm";
break;
case "FlashPixVersion":
$val = round($val / 100, 2);
break;
case "ColorSpace":
if($val==1) $val = "sRGB";
if($val=='65535') $val = "Uncalibrated";
break;
case "FocalPlaneXResolution":
$val = round(exif_get_str_val($val));
break;
case "FocalPlaneYResolution":
$val = round(exif_get_str_val($val));
break;
case "FocalPlaneResolutionUnit":
if($val==1) $val = "No Unit";
if($val==2) $val = "Inch";
if($val==3) $val = "Centimeter";
break;
case "SensingMethod":
if($val==2) $val = "1 chip color area sensor";
break;
case "FileSource":
$val = bin2hex($val);
if($val==0x03) $val = "Digital still camera";
break;
case "FileSource":
$val = bin2hex($val);
if($val==0x01) $val = "Directly photographed";
break;
}
return $val;
}
?>
FUNCTIONS.PHP
[code]<?php
/**************************************************************************
* *
* 4images - A Web Based Image Gallery Management System *
* ---------------------------------------------------------------- *
* *
* File: functions.php *
* Copyright: (C) 2002 Jan Sorgalla *
* Email: jan@4homepages.de *
* Web: http://www.4homepages.de *
* Scriptversion: 1.7 *
* *
* Never released without support from: Nicky (http://www.nicky.net) *
* *
**************************************************************************
* *
* Dieses Script ist KEINE Freeware. Bitte lesen Sie die Lizenz- *
* bedingungen (Lizenz.txt) für weitere Informationen. *
* --------------------------------------------------------------- *
* This script is NOT freeware! Please read the Copyright Notice *
* (Licence.txt) for further information. *
* *
*************************************************************************/
if (!defined('ROOT_PATH')) {
die("Security violation");
}
include(ROOT_PATH.'includes/exif.php');
function get_gallery_image($image_name) {
global $config;
if (file_exists(TEMPLATE_PATH."/images_".$config['language_dir']."/".$image_name)) {
return TEMPLATE_PATH."/images_".$config['language_dir']."/".$image_name;
}
else {
return TEMPLATE_PATH."/images/".$image_name;
}
}
function is_remote($file_name) {
return (preg_match('#^https?\\:\\/\\/[a-z0-9\-]+\.([a-z0-9\-]+\.)?[a-z]+#i', $file_name)) ? 1 : 0;
}
function is_remote_file($file_name) {
return (preg_match("#^(https?:\/\/[a-z0-9\-]+?\.([a-z0-9\-]+\.)*[a-z]+(:[0-9]+)*\/.*?\.([a-z]{1,4})$)#is", $file_name)) ? 1 : 0;
}
function is_local_file($file_name) {
return (preg_match("#^((\.)*\/.*?\.([a-z]{1,4})$)#is", $file_name)) ? 1 : 0;
}
function check_remote_media($remote_media_file) {
global $config;
return (preg_match("#^(https?:\/\/[a-z0-9\-]+?\.([a-z0-9\-]+\.)*[a-z]+(:[0-9]+)*\/.*?\.(".$config['allowed_mediatypes_match'].")$)#is", $remote_media_file)) ? 1 : 0;
}
function check_local_media($local_media_file) {
global $config;
return (preg_match("#^((\.)*\/.*?\.(".$config['allowed_mediatypes_match'].")$)#is", $local_media_file)) ? 1 : 0;
}
function check_remote_thumb($remote_thumb_file) {
return (preg_match("#^(https?:\/\/[a-z0-9\-]+?\.([a-z0-9\-]+\.)*[a-z]+(:[0-9]+)*\/.*?\.(gif|jpg|jpeg|png)$)#is", $remote_thumb_file)) ? 1 : 0;
}
function check_local_thumb($remote_thumb_file) {
return (preg_match("#^((\.)*\/.*?\.(gif|jpg|jpeg|png)$)#is", $remote_thumb_file)) ? 1 : 0;
}
function get_file_extension($file_name) {
ereg("(.+)\.(.+)", basename($file_name), $regs);
return strtolower($regs[2]);
}
function get_file_name($file_name) {
ereg("(.+)\.(.+)", basename($file_name), $regs);
return $regs[1];
}
function check_media_type($file_name) {
global $config;
return (in_array(get_file_extension($file_name), $config['allowed_mediatypes_array'])) ? 1 : 0;
}
function check_thumb_type($file_name) {
return (preg_match("#(gif|jpg|jpeg|png)$#is", $file_name)) ? 1 : 0;
}
function check_executable($file_name) {
if (substr(PHP_OS, 0, 3) == "WIN" && !eregi("\.exe$", $file_name)) {
$file_name .= ".exe";
}
elseif (substr(PHP_OS, 0, 3) != "WIN") {
$file_name = eregi_replace("\.exe$", "", $file_name);
}
return $file_name;
}
function get_file_path($file_name = "", $image_type = "media", $cat_id = 0, $in_admin = 0, $return_icon = 1, $check_remote = CHECK_REMOTE_FILES) {
$return_code = ($return_icon) ? ICON_PATH."/404.gif" : 0;
if (empty($file_name)) {
return $return_code;
}
if (is_remote($file_name)) {
$check_handle = "check_remote_".$image_type;
return ($check_handle($file_name) && remote_file_exists($file_name, $check_remote)) ? (($in_admin && !preg_match("#(gif|jpg|jpeg|png)$#is", $file_name)) ? ICON_PATH."/".get_file_extension($file_name).".gif" : $file_name) : $return_code;
}
elseif (is_local_file($file_name)) {
$check_handle = "check_local_".$image_type;
$file_name = ($in_admin && preg_match("/^([\.]+|[^\/])/", $file_name)) ? "../".$file_name : $file_name;
if (!file_exists($file_name)) {
$file_path = preg_replace("/\/{2,}/", "/", get_document_root()."/".$file_name);
return ($check_handle($file_name) && file_exists($file_path)) ? (($in_admin && !preg_match("#(gif|jpg|jpeg|png)$#is", $file_name)) ? ICON_PATH."/".get_file_extension($file_name).".gif" : $file_name) : $return_code;
}
else {
return $file_name;
}
}
else {
$check_handle = "check_".$image_type."_type";
$path = (($image_type == "media") ? (($cat_id) ? MEDIA_PATH."/".$cat_id : MEDIA_TEMP_PATH) : (($cat_id) ? THUMB_PATH."/".$cat_id : THUMB_TEMP_PATH))."/".$file_name;
return ($check_handle($file_name) && file_exists($path)) ? (($in_admin && !preg_match("#(gif|jpg|jpeg|png)$#is", $file_name)) ? ICON_PATH."/".get_file_extension($file_name).".gif" : $path) : $return_code;
}
}
function un_htmlspecialchars($chars) {
//$chars = preg_replace("/(&#)([0-9]*)(;)/esiU", "chr(intval('\\2'))", $chars);
$chars = str_replace(">", ">", $chars);
$chars = str_replace("<", "<", $chars);
$chars = str_replace(""", "\"", $chars);
$chars = str_replace("&", "&", $chars);
return $chars;
}
function get_iptc_info($info) {
$iptc_match = array();
$iptc_match['2#120'] = "caption";
$iptc_match['2#122'] = "caption_writer";
$iptc_match['2#105'] = "headline";
$iptc_match['2#040'] = "special_instructions";
$iptc_match['2#080'] = "byline";
$iptc_match['2#085'] = "byline_title";
$iptc_match['2#110'] = "credit";
$iptc_match['2#115'] = "source";
$iptc_match['2#005'] = "object_name";
$iptc_match['2#055'] = "date_created";
$iptc_match['2#090'] = "city";
$iptc_match['2#095'] = "state";
$iptc_match['2#101'] = "country";
$iptc_match['2#103'] = "original_transmission_reference";
$iptc_match['2#015'] = "category";
$iptc_match['2#020'] = "supplemental_category";
$iptc_match['2#025'] = "keyword";
$iptc_match['2#116'] = "copyright_notice";
$iptc = iptcparse($info);
$iptc_array = array();
if (is_array($iptc)) {
foreach ($iptc as $key => $val) {
if (isset($iptc_match[$key])) {
$iptc_info = "";
foreach ($val as $val2) {
$iptc_info .= (($iptc_info != "" ) ? ", " : "").$val2;
}
if ($key == "2#055") {
$iptc_array[$iptc_match[$key]] = preg_replace("/([0-9]{4})([0-9]{2})([0-9]{2})/", "\\3.\\2.\\1", $iptc_info);
}
else {
$iptc_array[$iptc_match[$key]] = replace_url($iptc_info);
}
}
}
}
return $iptc_array;
}
function show_image($image_row, $mode = "", $show_link = 1, $detailed_view = 0) {
global $self_url, $site_template, $site_sess, $user_info, $config, $cat_cache, $lang, $additional_image_fields, $user_table_fields, $url_show_profile;
$is_new = ($image_row['image_date'] >= (time() - 60 * 60 * 24 * $config['new_cutoff'])) ? 1 : 0;
$description = (!empty($image_row['image_description'])) ? format_text($image_row['image_description'], 1) : REPLACE_EMPTY;
if (!empty($image_row['image_keywords'])) {
$split_keywords = explode(" ", $image_row['image_keywords']);
$keywords = "";
foreach ($split_keywords as $key => $val) {
$keywords .= (($keywords != "" ) ? ", " : "")."<a href=\"".$site_sess->url(ROOT_PATH."search.php?search_keywords=".urlencode($val))."\">$val</a>";
}
}
else {
$keywords = REPLACE_EMPTY;
}
if (!check_permission("auth_readcomment", $image_row['cat_id'])) {
$image_row['image_allow_comments'] = 0;
}
$num_comments = ($image_row['image_allow_comments'] == 1) ? $image_row['image_comments'] : "";
if ($user_info['user_level'] != GUEST) {
$lightbox_url = $self_url;
$lightbox_url .= (!empty($mode)) ? ((preg_match("/\?/", $lightbox_url)) ? "&" : "?")."mode=".$mode : "";
$lightbox_url .= preg_match("/\?/", $lightbox_url) ? "&" : "?";
if (check_lightbox($image_row['image_id'])) {
$lightbox_url .= "action=removefromlightbox&id=".$image_row['image_id'];
$lightbox_button = "<a href=\"".$site_sess->url($lightbox_url)."\"><img src=\"".get_gallery_image("lightbox_yes.gif")."\" border=\"0\" alt=\"\" /></a>";
}
else {
$lightbox_url .= "action=addtolightbox&id=".$image_row['image_id'];
$lightbox_button = "<a href=\"".$site_sess->url($lightbox_url)."\"><img src=\"".get_gallery_image("lightbox_no.gif")."\" border=\"0\" alt=\"\" /></a>";
}
}
else {
$lightbox_button = "<img src=\"".get_gallery_image("lightbox_off.gif")."\" border=\"0\" alt=\"\" />";
}
if (!check_permission("auth_download", $image_row['cat_id'])) {
$download_button = "<img src=\"".get_gallery_image("download_off.gif")."\" border=\"0\" alt=\"\" />";
$download_zip_button = (function_exists("gzcompress") && function_exists("crc32")) ? "<img src=\"".get_gallery_image("download_zip_off.gif")."\" border=\"0\" alt=\"\" />" : "";
$allow_download = 0;
}
else {
$target = (!empty($image_row['image_download_url']) && !is_remote_file($image_row['image_download_url']) && !is_local_file($image_row['image_download_url'])) ? "target=\"_blank\"" : "";
$download_button = "<a href=\"".$site_sess->url(ROOT_PATH."download.php?".URL_IMAGE_ID."=".$image_row['image_id'])."\"".$target."><img src=\"".get_gallery_image("download.gif")."\" border=\"0\" alt=\"\" /></a>";
$download_zip_button = ($target == "" && function_exists("gzcompress") && function_exists("crc32")) ? "<a href=\"".$site_sess->url(ROOT_PATH."download.php?action=zip&".URL_IMAGE_ID."=".$image_row['image_id'])."\"".$target."><img src=\"".get_gallery_image("download_zip.gif")."\" border=\"0\" alt=\"\" /></a>" : "";
$allow_download = 1;
}
if (!check_permission("auth_sendpostcard", $image_row['cat_id'])) {
$postcard_button = "<img src=\"".get_gallery_image("postcard_off.gif")."\" border=\"0\" alt=\"\" />";
}
else {
$postcard_button = "<a href=\"".$site_sess->url(ROOT_PATH."postcards.php?".URL_IMAGE_ID."=".$image_row['image_id'].((!empty($mode)) ? "&mode=".$mode : ""))."\"><img src=\"".get_gallery_image("postcard.gif")."\" border=\"0\" alt=\"\" /></a>";
}
if (!check_permission("auth_viewimage", $image_row['cat_id']) || !check_permission("auth_viewcat", $image_row['cat_id'])) {
$show_link = 0;
}
$file_size = "n/a";
if (!is_remote($image_row['image_media_file'])) {
if ($file_size = @filesize(MEDIA_PATH."/".$image_row['cat_id']."/".$image_row['image_media_file'])) {
$file_size = format_file_size($file_size);
}
}
elseif ($detailed_view) {
$file_size = get_remote_file_size($image_row['image_media_file']);
}
if (isset($image_row[$user_table_fields['user_name']]) && $image_row['user_id'] != GUEST) {
$user_name = $image_row[$user_table_fields['user_name']];
$user_profile_link = (!empty($url_show_profile)) ? preg_replace("/{user_id}/", $image_row['user_id'], $url_show_profile) : ROOT_PATH."member.php?action=showprofile&".URL_USER_ID."=".$image_row['user_id'];
$user_name_link = "<a href=\"".$site_sess->url($user_profile_link)."\">".$user_name."</a>";
}
else {
$user_name = $lang['userlevel_guest'];
$user_name_link = $user_name;
}
$site_template->register_vars(array(
"image_id" => $image_row['image_id'],
"user_id" => $image_row['user_id'],
"user_name" => $user_name,
"user_name_link" => $user_name_link,
"image_name" => $image_row['image_name'],
"image_description" => $description,
"image_keywords" => $keywords,
"image_date" => format_date($config['date_format']." ".$config['time_format'],$image_row['image_date']),
"image_is_new" => $is_new,
"lang_new" => $lang['new'],
"image_active" => $image_row['image_active'],
"cat_id" => $image_row['cat_id'],
"cat_name" => $image_row['cat_name'],
"cat_url" => $site_sess->url(ROOT_PATH."categories.php?".URL_CAT_ID."=".$image_row['cat_id']),
"image_downloads" => $image_row['image_downloads'],
"image_votes" => $image_row['image_votes'],
"image_rating" => $image_row['image_rating'],
"image_hits" => $image_row['image_hits'],
"allow_comments" => $image_row['image_allow_comments'],
"lang_comments" => $lang['comments'],
"image_comments" => $num_comments,
"lightbox_button" => $lightbox_button,
"postcard_button" => $postcard_button,
"download_button" => $download_button,
"download_zip_button" => $download_zip_button,
"image_download_url" => $image_row['image_download_url'],
"allow_download" => $allow_download,
"url_download" => $site_sess->url(ROOT_PATH."download.php?".URL_IMAGE_ID."=".$image_row['image_id']),
"image_file_size" => $file_size,
"image" => get_media_code($image_row['image_media_file'], $image_row['image_id'], $image_row['cat_id'], $image_row['image_name'], $mode, $show_link, $detailed_view),
"thumbnail" => get_thumbnail_code($image_row['image_media_file'], $image_row['image_thumb_file'], $image_row['image_id'], $image_row['cat_id'], $image_row['image_name'], $mode, $show_link),
"thumbnail_openwindow" => get_thumbnail_code($image_row['image_media_file'], $image_row['image_thumb_file'], $image_row['image_id'], $image_row['cat_id'], $image_row['image_name'], $mode, $show_link, 1),
"image_file_name" => $image_row['image_media_file'],
"thumbnail_file_name" => $image_row['image_thumb_file']
));
if (!empty($additional_image_fields)) {
$additional_field_array = array();
foreach ($additional_image_fields as $key => $val) {
$additional_field_array[$key] = (!empty($image_row[$key])) ? format_text($image_row[$key], 1) : REPLACE_EMPTY;
$additional_field_array['lang_'.$key] = $val[0];
}
if (!empty($additional_field_array)) {
$site_template->register_vars($additional_field_array);
}
}
$rate_form = "";
if (check_permission("auth_vote", $image_row['cat_id'])) {
$site_template->register_vars("rate", $lang['rate']);
$rate_form = $site_template->parse_template("rate_form");
}
$site_template->register_vars("rate_form", $rate_form);
return true;
}
function get_thumbnail_code($media_file_name, $thumb_file_name = "", $image_id, $cat_id, $image_name = "", $mode = "", $show_link = 1, $open_window = 0) {
global $site_sess, $config;
if (!check_media_type($media_file_name)) {
$thumb = "<img src=\"".ICON_PATH."/404.gif\" border=\"0\" alt=\"\" />";
}
else {
if (!get_file_path($thumb_file_name, "thumb", $cat_id, 0, 0)) {
$file_src = ICON_PATH."/".get_file_extension($media_file_name).".gif";
$image_info = @getimagesize($dummy);
$width_height = (!empty($image_info[3])) ? " ".$image_info[3] : "";
$thumb = "<img src=\"".$file_src."\" border=\"0\"".$width_height." alt=\"".$image_name."\" />";
}
else {
$file_src = get_file_path($thumb_file_name, "thumb", $cat_id, 0, 1);
$image_info = @getimagesize($file_src);
$width_height = (!empty($image_info[3])) ? " ".$image_info[3] : "";
$thumb = "<img src=\"".$file_src."\" border=\"".$config['image_border']."\"".$width_height." alt=\"".$image_name."\" />";
}
}
if ($show_link) {
if ($open_window) {
$thumb = "<a href=\"".$site_sess->url(ROOT_PATH."details.php?".URL_IMAGE_ID."=".$image_id.((!empty($mode)) ? "&mode=".$mode : ""))."\" onclick=\"opendetailwindow()\" target=\"detailwindow\">".$thumb."</a>";
}
else {
$thumb = "<a href=\"".$site_sess->url(ROOT_PATH."details.php?".URL_IMAGE_ID."=".$image_id.((!empty($mode)) ? "&mode=".$mode : ""))."\">".$thumb."</a>";
}
}
return $thumb;
}
function get_media_code($media_file_name, $image_id = 0, $cat_id = 0, $image_name = "", $mode = "", $show_link = 0, $detailed_view = 0) {
global $site_template, $site_sess, $lang, $mode;
if (!get_file_path($media_file_name, "media", $cat_id, 0, 0)) {
$media = "<img src=\"".ICON_PATH."/404.gif\" border=\"0\" alt=\"\" />";
$site_template->register_vars("iptc_info", "");
}
else {
$media_src = get_file_path($media_file_name, "media", $cat_id, 0, 1);
$file_extension = get_file_extension($media_file_name);
$media_icon = "<img src=\"".ICON_PATH."/".$file_extension.".gif\" border=\"0\" alt=\"".$image_name."\" />";
if ($show_link) {
$media_icon = "<a href=\"".$site_sess->url(ROOT_PATH."details.php?".URL_IMAGE_ID."=".$image_id.((!empty($mode)) ? "&mode=".$mode : ""))."\">".$media_icon."</a>";
}
$width_height = "";
$width = "";
$height = "";
$iptc_info = "";
$src = (!file_exists($media_src) && file_exists(preg_replace("/\/{2,}/", "/", get_document_root()."/".$media_src))) ? preg_replace("/\/{2,}/", "/", get_document_root()."/".$media_src) : $media_src;
if ($image_info = @getimagesize($src, $info)) {
$width_height = " ".$image_info[3];
$width = $image_info[0];
$height = $image_info[1];
if ($detailed_view && isset($info['APP13'])) {
$iptc_array = get_iptc_info($info['APP13']);
$bgcounter = 0;
foreach ($iptc_array as $key => $val) {
$row_bg_number = ($bgcounter++ % 2 == 0) ? 1 : 2;
$site_template->register_vars(array(
"iptc_value" => $val,
"iptc_name" => $lang['iptc_'.$key],
"row_bg_number" => $row_bg_number
));
$iptc_info .= $site_template->parse_template("iptc_bit");
}
}
define('BACKUPDIR', "/home/huellasp/public_html/4images/backupimages");
$exif_info = "";
$src_backup = BACKUPDIR."/".$cat_id."/".$media_file_name;
if ((($file_extension == "jpg") || ($file_extension == "jpeg")) &&($detailed_view)) {
$exif = exif_read_data ($src_backup,'IFD0');
$bgcounter = 0;
if ($exif) {
$exif = exif_read_data ($src_backup,0,true);
foreach($exif as $key=>$section) {
if (($key == "IFD0") || ($key == "EXIF")) {
foreach($section as $name=>$val) {
if (!(exif_filter($name)) && exif_filter_control()) continue;
$row_bg_number = ($bgcounter++ % 2 == 0) ? 1 : 2;
$site_template->register_vars(array(
"exif_value" => exif_parse_value($name, $val),
"exif_name" => $name . ":",
"row_bg_number" => $row_bg_number
));
$exif_info .= $site_template->parse_template("exif_bit");
}
}
}
}
}
}
$site_template->register_vars(array(
"media_src" => $media_src,
"media_icon" => $media_icon,
"image_name" => $image_name,
"width_height" => $width_height,
"width" => $width,
"height" => $height,
"iptc_info" => $iptc_info,
"exif_info" => $exif_info
));
$media = $site_template->parse_template("media/".$file_extension);
}
return $media;
}
function get_random_image_cache() {
global $site_db, $cat_cache, $total_images;
$random_image_cache = array();
$cat_id_sql = get_auth_cat_sql("auth_viewcat", "NOTIN");
if (SHOW_RANDOM_CAT_IMAGE) {
$sql = "SELECT DISTINCT i.image_id, i.cat_id, i.user_id, i.image_name, i.image_description, i.image_keywords, i.image_date, i.image_active, i.image_media_file, i.image_thumb_file, i.image_download_url, i.image_allow_comments, i.image_comments, i.image_downloads, i.image_votes, i.image_rating, i.image_hits, c.cat_name".get_user_table_field(", u.", "user_name")."
FROM ".IMAGES_TABLE." i, ".CATEGORIES_TABLE." c
LEFT JOIN ".USERS_TABLE." u ON (".get_user_table_field("u.", "user_id")." = i.user_id)
WHERE i.image_active = 1 AND i.cat_id NOT IN ($cat_id_sql) AND c.cat_id = i.cat_id
ORDER BY RAND()";
$result = $site_db->query($sql);
while ($row = $site_db->fetch_array($result)) {
$random_image_cache[$row['cat_id']] = $row;
}
}
else {
if (empty($total_images)) {
$sql = "SELECT COUNT(*) as total_images
FROM ".IMAGES_TABLE."
WHERE image_active = 1 AND cat_id NOT IN ($cat_id_sql)";
$row = $site_db->query_firstrow($sql);
$total_images = $row['total_images'];
}
if (empty($total_images)) {
return $random_image_cache;
}
mt_srand((double)microtime() * 1000000);
$number = ($total_images > 1) ? mt_rand(0, $total_images - 1) : 0;
$sql = "SELECT i.image_id, i.cat_id, i.user_id, i.image_name, i.image_description, i.image_keywords, i.image_date, i.image_active, i.image_media_file, i.image_thumb_file, i.image_download_url, i.image_allow_comments, i.image_comments, i.image_downloads, i.image_votes, i.image_rating, i.image_hits, c.cat_name".get_user_table_field(", u.", "user_name")."
FROM ".IMAGES_TABLE." i, ".CATEGORIES_TABLE." c
LEFT JOIN ".USERS_TABLE." u ON (".get_user_table_field("u.", "user_id")." = i.user_id)
WHERE i.image_active = 1 AND i.cat_id NOT IN ($cat_id_sql) AND c.cat_id = i.cat_id
LIMIT $number, 1";
$random_image_cache[0] = $site_db->query_firstrow($sql);
}
return $random_image_cache;
}
function get_random_image($cat_id = 0, $show_link = 1, $return_file = 0) {
global $site_template, $random_image_cache;
if (!isset($random_image_cache)) {
$random_image_cache = get_random_image_cache();
}
if ($cat_id && SHOW_RANDOM_CAT_IMAGE) {
$template = 'random_cat_image';
$category_id = $cat_id;
}
else {
$template = 'random_image';
if (SHOW_RANDOM_CAT_IMAGE) {
srand((float)microtime() * 1000000);
$category_id = array_rand($random_image_cache);
}
else {
$category_id = 0;
}
}
if (!empty($random_image_cache[$category_id])) {
if (!$return_file) {
show_image($random_image_cache[$category_id], "", $show_link);
$random_image = $site_template->parse_template($template);
return $random_image;
}
else {
return get_file_path($random_image_cache[$category_id]['image_thumb_file'], "thumb", $category_id, 0, 1);
}
}
}
function format_file_size($file_size = 0) {
$file_size = intval($file_size);
if (!$file_size) {
return "n/a";
}
if (strlen($file_size) <= 9 && strlen($file_size) >= 7) {
$file_size = number_format($file_size / 1048576,1);
return $file_size." MB";
}
elseif (strlen($file_size) >= 10) {
$file_size = number_format($file_size / 1073741824,1);
return $file_size." GB";
}
else {
$file_size = number_format($file_size / 1024,1);
return $file_size." KB";
}
}
function get_remote_file_size($file_path) {
ob_start();
@readfile($file_path);
$file_data = ob_get_contents();
ob_end_clean();
return format_file_size(strlen($file_data));
}
function update_comment_count($image_id = 0, $user_id = 0) {
global $site_db, $user_table_fields;
if ($image_id) {
$sql = "SELECT COUNT(comment_id) AS comments
FROM ".COMMENTS_TABLE."
WHERE image_id = $image_id";
$countcomments = $site_db->query_firstrow($sql);
$sql = "UPDATE ".IMAGES_TABLE."
SET image_comments = ".$countcomments['comments']."
WHERE image_id = $image_id";
$site_db->query($sql);
}
if ($user_id != GUEST && $user_id && !empty($user_table_fields['user_comments'])) {
$sql = "SELECT COUNT(comment_id) AS comments
FROM ".COMMENTS_TABLE."
WHERE user_id = $user_id";
$countcomments = $site_db->query_firstrow($sql);
$sql = "UPDATE ".USERS_TABLE."
SET ".get_user_table_field("", "user_comments")." = ".$countcomments['comments']."
WHERE ".get_user_table_field("", "user_id")." = $user_id";
$site_db->query($sql);
}
}
function update_image_rating($image_id, $rating) {
global $site_db;
$sql = "SELECT cat_id, image_votes, image_rating
FROM ".IMAGES_TABLE."
WHERE image_id = $image_id";
$image_row = $site_db->query_firstrow($sql);
if (check_permission("auth_vote", $image_row['cat_id'])) {
$old_votes = $image_row['image_votes'];
$old_rating = $image_row['image_rating'];
$new_rating = (($old_rating * $old_votes) + $rating) / ($old_votes + 1);
$new_rating = sprintf("%.2f", $new_rating);
$sql = "UPDATE ".IMAGES_TABLE."
SET image_votes = ($old_votes + 1), image_rating = '$new_rating'
WHERE image_id = $image_id";
$site_db->query($sql);
}
}
function check_email($email) {
return (preg_match('/^[-!#$%&\'*+\\.\/0-9=?A-Z^_`{|}~]+@([-0-9A-Z]+\.)+([0-9A-Z]){2,4}$/i', $email)) ? 1 : 0;
}
function format_date($format, $timestamp) {
global $user_info;
$timezone_offset = (defined("TIME_OFFSET")) ? TIME_OFFSET : 0;
return date($format, $timestamp + (3600 * $timezone_offset));
}
function format_url($url) {
if (!preg_match("/^http:\/\//i", $url)) {
$url = "http://".$url;
}
if (!preg_match("/^https?\\:\\/\\/[a-z0-9\-]+\.([a-z0-9\-]+\.)?[a-z]+/i", $url)) {
$url = "";
}
return $url;
}
function replace_url($text) {
$text = " ".$text." ";
$url_search_array = array(
"#([^]_a-z0-9-=\"'\/])([a-z]+?)://([^, \(\)<>\n\r]+)#si",
"#([^]_a-z0-9-=\"'\/])www\.([a-z0-9\-]+)\.([a-z0-9\-.\~]+)((?:/[^, \(\)<>\n\r]*)?)#si"
);
$url_replace_array = array(
"\\1<a href=\"\\2://\\3\" target=\"_blank\">\\2://\\3</a>",
"\\1<a href=\"http://www.\\2.\\3\\4\" target=\"_blank\">www.\\2.\\3\\4</a>"
);
$text = preg_replace($url_search_array, $url_replace_array, $text);
if (strpos($text, "@")) {
$text = preg_replace("#([\n ])([a-z0-9\-_.]+?)@([\w\-]+\.([\w\-\.]+\.)?[\w]+)#i", "\\1<a href=\"mailto:\\2@\\3\">\\2@\\3</a>", $text);
}
return trim($text);
}
function replace_badwords($text) {
global $config, $split_badwords;
if ($config['badword_list'] != "") {
if (!isset($split_badwords)) {
$badwords = trim($config['badword_list']);
$badwords = preg_replace("/[\n\r]/is", " ", $badwords);
$badwords = str_replace(","," ",$badwords);
$badwords = preg_quote($badwords);
$badwords = str_replace('/', '\\/', $badwords);
$split_badwords = preg_split("/\s+/", $badwords);
}
foreach ($split_badwords as $key => $val) {
if ($val != "") {
if (substr($val, 0, 2) == "\\{") {
$val = substr($val, 2, -2);
$text = trim(preg_replace("/([^A-Za-z])".$val."(?=[^A-Za-z])/si", "\\1".str_repeat($config['badword_replace_char'], strlen($val)), " $text "));
}
else {
$text = trim(preg_replace("/$val/si", str_repeat($config['badword_replace_char'], strlen($val)), " $text "));
}
}
}
}
return $text;
}
function format_text($text, $html = 0, $word_wrap = 0, $bbcode = 0, $bbcode_img = 0) {
$text = trim($text);
if ($word_wrap && $text != "") {
$text = preg_replace("/([^\n\r ?&\.\/<>\"\\-]{".$word_wrap."})/i", " \\1\n", $text);
}
if ($html == 0) {
$text = str_replace("<", "&lt;", $text);
$text = str_replace(">", "&gt;", $text);
$text = str_replace("<", "<", $text);
$text = str_replace(">", ">", $text);
}
$text = str_replace("\n", "<br />", $text);
$text = replace_url($text);
if ($bbcode == 1) {
$search_array = array(
"/(\[)(list)(=)(['\"]?)([^\"']*)(\\4])(.*)(\[\/list)(((=)(\\4)([^\"']*)(\\4]))|(\]))/siU",
"/(\[)(list)(])(.*)(\[\/list\])/siU",
"/(\[\*\])/siU",
"/(\[)(url)(=)(['\"]?)(www\.)([^\"']*)(\\4])(.*)(\[\/url\])/siU",
"/(\[)(url)(=)(['\"]?)([^\"']*)(\\4])(.*)(\[\/url\])/siU",
"/(\[)(url)(])(www\.)([^\"]*)(\[\/url\])/siU",
"/(\[)(url)(])([^\"]*)(\[\/url\])/siU",
"/(\[)(code)(])(\r\n)*(.*)(\[\/code\])/siU",
"/javascript:/si",
"/about:/si"
);
$replace_array = array(
"<ol type=\"\\5\">\\7</ol>",
"<ul>\\4</ul>",
"<li>",
"<a href=\"http://www.\\6\" target=\"_blank\">\\8</a>",
"<a href=\"\\5\" target=\"_blank\">\\7</a>",
"<a href=\"http://www.\\5\" target=\"_blank\">www.\\5</a>",
"<a href=\"\\4\" target=\"_blank\">\\4</a>",
"<pre>Code:<hr size=1>\\5<hr size=1></pre>",
"java script:",
"about :"
);
$text = preg_replace($search_array, $replace_array, $text);
if (!$bbcode_img) {
$text = preg_replace("/(\[)(img)(])(\r\n)*([^\"]*)(\[\/img\])/siU", "<a href=\"\\5\" target=\"_blank\">\\5</a>", $text);
}
else {
$text = preg_replace("/(\[)(img)(])(\r\n)*([^\"]*)(\[\/img\])/siU", "<img src=\"\\5\">", $text);
}
$text = preg_replace("/(\[)(b)(])(\r\n)*([^\"]*)(\[\/b\])/siU", "<b>\\5</b>", $text);
$text = preg_replace("/(\[)(i)(])(\r\n)*([^\"]*)(\[\/i\])/siU", "<i>\\5</i>", $text);
$text = preg_replace("/(\[)(u)(])(\r\n)*([^\"]*)(\[\/u\])/siU", "<u>\\5</u>", $text);
}
$text = str_replace("\\'", "'", $text);
return replace_badwords($text);
}
function get_user_info($user_id = 0) {
global $site_db, $user_table_fields;
$user_info = 0;
if ($user_id != 0 && $user_id != GUEST) {
$sql = "SELECT *
FROM ".USERS_TABLE."
WHERE ".get_user_table_field("", "user_id")." = $user_id";
if ($user_info = $site_db->query_firstrow($sql)) {
foreach ($user_table_fields as $key => $val) {
if (isset($user_info[$val])) {
$user_info[$key] = $user_info[$val];
}
elseif (!isset($user_info[$key])) {
$user_info[$key] = "";
}
}
}
}
return $user_info;
}
function get_icq_status($uin) {
// From: http://www.koehntopp.de/php/snippets.html#code-icq
if (!is_numeric($uin)) return FALSE;
$fp = @fsockopen('wwp.icq.com', 80, $errno, $errstr, 8);
if (!$fp) return FALSE;
$request = "HEAD /scripts/online.dll?icq=$uin&img=5 HTTP/1.0\r\n"
."Host: wwp.icq.com\r\n"
."Connection: close\r\n\r\n";
fputs($fp, $request);
do {
$response = fgets($fp, 1024);
}
while (!feof($fp) && !stristr($response, 'Location'));
fclose($fp);
if (strstr($response, '4367')) return 'online';
if (strstr($response, '4349')) return 'offline';
if (strstr($response, '4386')) return 'disabled';
return FALSE;
}
function add_to_lightbox($id) {
global $user_info, $site_db;
$id = intval($id);
if (!$id) {
return false;
}
$lightbox_ids = $user_info['lightbox_image_ids'];
$lightbox_array = explode(" ", $lightbox_ids);
if (!in_array($id, $lightbox_array)) {
$lightbox_ids .= " ".$id;
}
$user_info['lightbox_image_ids'] = trim($lightbox_ids);
$user_info['lightbox_lastaction'] = time();
$sql = "UPDATE ".LIGHTBOXES_TABLE."
SET lightbox_lastaction = ".$user_info['lightbox_lastaction'].", lightbox_image_ids = '".$user_info['lightbox_image_ids']."'
WHERE user_id = ".$user_info['user_id'];
return ($site_db->query($sql)) ? 1 : 0;
}
function remove_from_lightbox($id) {
global $user_info, $site_db;
$lightbox_array = explode(" ",$user_info['lightbox_image_ids']);
foreach ($lightbox_array as $key => $val) {
if ($val == $id) {
unset($lightbox_array[$key]);
}
}
$user_info['lightbox_image_ids'] = trim(implode(" ", $lightbox_array));
$user_info['lightbox_lastaction'] = time();
$sql = "UPDATE ".LIGHTBOXES_TABLE."
SET lightbox_lastaction = ".$user_info['lightbox_lastaction'].", lightbox_image_ids = '".$user_info['lightbox_image_ids']."'
WHERE user_id = ".$user_info['user_id'];
return ($site_db->query($sql)) ? 1 : 0;
}
function clear_lightbox() {
global $user_info, $site_db;
$current_time = time();
$sql = "UPDATE ".LIGHTBOXES_TABLE."
SET lightbox_image_ids = '', lightbox_lastaction = $current_time
WHERE user_id = ".$user_info['user_id'];
if ($site_db->query($sql)) {
$user_info['lightbox_image_ids'] = "";
$user_info['lightbox_lastaction'] = $current_time;
return true;
}
else {
return false;
}
}
function check_lightbox($id) {
global $user_info;
$lightbox_array = explode(" ", $user_info['lightbox_image_ids']);
return in_array($id, $lightbox_array);
}
function get_random_key($db_table = "", $db_column = "") {
global $site_db;
$key = md5(uniqid(microtime()));
if ($db_table != "" && $db_column != "") {
$i = 0;
while ($i == 0) {
$sql = "SELECT ".$db_column."
FROM ".$db_table."
WHERE ".$db_column." = '$key'";
if ($site_db->is_empty($sql)) {
$i = 1;
}
else {
$i = 0;
$key = md5(uniqid(microtime()));
}
}
}
return $key;
}
function get_subcat_ids($cid = 0, $cat_id = 0, $cat_parent_cache) {
global $subcat_ids;
if (!isset($cat_parent_cache[$cid])) {
return false;
}
foreach ($cat_parent_cache[$cid] as $key => $val) {
if (check_permission("auth_viewcat", $val)) {
$subcat_ids[$cat_id][] = $val;
get_subcat_ids($val, $cat_id, $cat_parent_cache);
}
}
return $subcat_ids;
}
function get_subcategories($parent_id) {
global $cat_parent_cache, $cat_cache, $site_sess, $config;
if (!isset($cat_parent_cache[$parent_id]) || $config['num_subcats'] < 1) {
return "";
-
I'm using exif 0.3 mod and in last few monts I'm getting this error:
Warning: exif_read_data(605493564.jpg): illegal IFD size: x07F6 + 2 + x0810*12 = x68B6 > x07F4 in /home/mywebhost/4images/includes/functions.php on line 625
Anyone know what could be wrong?
-
does this mod work with V1.71 as ahve installed it several times but still have errors
if ($detailed_view && isset($info['APP13'])) {
$iptc_array = get_iptc_info($info['APP13']);
$bgcounter = 0;
foreach ($iptc_array as $key => $val) {
$row_bg_number = ($bgcounter++ % 2 == 0) ? 1 : 2;
$site_template->register_vars(array(
"iptc_value" => $val,
"iptc_name" => $lang['iptc_'.$key],
"row_bg_number" => $row_bg_number
));
$iptc_info .= $site_template->parse_template("iptc_bit");
}
}
in version 1.71 it has 3 of these }}} at the end of the line
tried everything any suggestions
thanks
-
Hi,
i use 4images 1.7.1 and added the code for dem EXIF 0.3 MOD from fatman. I think i made it correctly, but the only thing i saw in my datails.htm is
{if exif_info}
EXIF Info
{endif exif_info}
all other infos (Filename, comments) will show right. Do anybody know the mistake what i possibly done?
-
try this :D
http://www.4homepages.de/forum/index.php?topic=6806.0
-
try this :D
http://www.4homepages.de/forum/index.php?topic=6806.0
Thanks, but this doesn't work too. Now EXIF Info titel is shown but nothing else. I knwo that the Pictures have Exif Info. Colud it be that this Mod doesn't work with the Version 1.7.1? Do anybody know another simple EXIF MOD? I want only see a few Exif Data, not all.
-
try this :D
http://www.4homepages.de/forum/index.php?topic=6806.0
Thanks, but this doesn't work too. Now EXIF Info titel is shown but nothing else. I knwo that the Pictures have Exif Info. Colud it be that this Mod doesn't work with the Version 1.7.1? Do anybody know another simple EXIF MOD? I want only see a few Exif Data, not all.
yes i have the same problem anyone get this to work with 1.71 please :)
-
Same problem as artpics
This 0.3 MOD doesn't work for me with 1.7.1 :(
Any suggestions or updates to the mod?
-
Hallo Leute,
stell mich wahrscheinlich zu doof an. Bekomme folgende Fehlermeldung
Warning: exif_read_data() [function.exif-read-data]: unable to open file in /***/***/galerie/includes/functions.php on line 388
(Zeile 388) $exif = exif_read_data ($src_backup,'IFD0');
Danke für eure Antworten
-
welche php version hast du und ist es aktiviert?
gruss
vincent
-
welche php version hast du und ist es aktiviert?
Naja vom System her wird ich sagen ist alles im grünen Bereich.
PHP Version 4.3.1
EXIF Support enabled
EXIF Version 1.4 $Id: exif.c,v 1.118.2.12 2002/12/23 08:43:13 sesser Exp $
Danke
-
Hallo Leute,
stell mich wahrscheinlich zu doof an. Bekomme folgende Fehlermeldung
Warning: exif_read_data() [function.exif-read-data]: unable to open file in /***/***/galerie/includes/functions.php on line 388
(Zeile 388) $exif = exif_read_data ($src_backup,'IFD0');
Danke für eure Antworten
Hi,
ich bekomme denselben bzw. nen ähnlichen fehler. Er wird durch folgenden Code in der functions.php erzeugt:
define('BACKUPDIR', "/home/huellasp/public_html/4images/backupimages");
$exif_info = "";
$src_backup = BACKUPDIR."/".$cat_id."/".$media_file_name;
if ((($file_extension == "jpg") || ($file_extension == "jpeg")) &&($detailed_view)) {
$exif = exif_read_data ($src_backup,'IFD0');
wobei mir irgendwie nicht klar ist, wozu dieser gut sein soll. Wozu backupdir ?
Das MOD läuft nicht bei mir! exif-support ist aber in php eingebaut.
Gruß
Christian
-
noch mal eine kurze frage an die Experten.
Kann Chris und mir jemand behilflich sein, such mich Tod wo der Fehler liegen könnte.
DAAANNNKKKEEEE
-
nun ich hab den MOD nicht installiert weil dazumal meine PHP Version auf dem Server zu alt war!
zu eurem Problem habt ihr beide die version 1.7.1?
gruss
vincent
-
Also bei mir läuft Version 1.7.1 ganz neu installiert.
Und der Fehler ist mit dem von Chris identisch. Es geht hauptsächlich um folgende Zeile
$exif = exif_read_data ($src_backup,'IFD0');
die ja mit dem anderen von Chris geposteten Scripteil zusammenhängt.
Danke für deine Hilfe
-
Vorsichtig würde ich sagen es könnte an der Version 1.7.1 liegen! :?
weil anscheinend geht es ja denk ich mal!
gruss
vincent
-
Hi,
habe heute mal einige "betroffene" Images mit XNVIEW angefaßt - sprich etwas geändert (Kompri etc.), do daß die Bilder damit neu erzeugt wurden - siehe da: keine Fehler mehr. Evtl. könnt Ihr das ja mal gegeprüfen - ich vermute, es liegt an div. Bildbearbeitungs-SW, denn Images, die direkt von der Cam kommen oder nur mit XNVIEW verkleinert wurden, liefern bei mir keine Fehler.
Grüße,
Henry
-
OK ich versuch es zu installieren - wobei die erste seite mit dem inhalt komisch aussieht - wie mit sonderzeichen? :?
vincent
-
i have this error
Fatal error: Call to undefined function: read_exif_data()
what can i do ??
-
ich hab es installiert - bekommer keine error meldung - nur eine weisse seite!
i don't get errors - just a blanck with page
why?
vincent
-
bei mir treten "illegal IFD pointer warnings" auch nur bei bestimmten bildern auf. auf http://home.arcor.de/ahuggel/exiv2/makernote.html steht, dass die IFD spezifikation einen bug enthält. es sind wohl wirklich die bearbeitungsprogramme, die ihren mist in's MakerNote feld schreiben wollen, was dann in die hose geht.
also hab ich das MakerNote feld mit in die exif.php aufgenommen und anzeigen lassen. bei bildern, wo das feld leer ist kommt kein fehler. bei bildern, die "illegal IFD pointer warnings" bringen steht ziemlicher Müll im MakerNote feld.
Beispiel: http://fisherstreetblues.com/gallery/details.php?image_id=83
ganz schöner mist, das.
-
Bedeutet also, man müßte das Auslesen "dieses" Feldes unterbinden oder das irgendwie patchen...
Na ich frage mal mir bekannte PHP-Gurus ;-)
Grüße,
Henry
-
as soon i add this part
include(ROOT_PATH.'includes/exif.php');
the homepage at all is not starting just a with page??
vincent
-
bei mir läuft der mod, allerdings habe ich ein kleines problem damit - es wird bei der auslösezeit jeweils eine null zuviel angehängt
zb. hier war die zeit 1/400 aber angezeigt wird 10/4000
(http://www.hobby-fotografen.com/data/thumbnails/16/586.jpg) (http://www.hobby-fotografen.com/details.php?image_id=586)
weiß wer rat?
mit opanda iexif wird die zeit zb. normal ausgelesen
-
Hi Vincent,
did you have changed some in exif.php? And exif.php is in includes/ on your server?
Sometimes a white page will shown, is some code are wrong but you don't get errors becaus the server is busy (or anything like this) - i've had this some days before by changing sql-codes...
Second:
Check your EXIF on Server by using a new file readexif.php. use following code
<?php
$exif = read_exif_data ('xxxxx.jpg');
while(list($k,$v)=each($exif)) {
echo "$k: $v<br>\n";
}
?>
But you have to change xxxxx.jpg in one file (containing exif-data) on your server out in same directory like this file!
You have to receive some exif-Data from this pic.
Regards,
Henry
-
@henary
also da kommt was raus http://www.foto-kocher.com/readexif.php
gruss
vincent
-
oki, dann funzt EXIF generell auf "Deinem" Server. Halbe Miete.
Wie ist das mit Änderungen in der exif.php?
Ich überlege schon mal weiter ;-)
Henry
-
Habe Nachgedacht ;-)
Nur, weil das "includen" der exif.php zu einer weißen Seite führt, bedeutet das nicht, daß diese zum Fehler führt. Probiere mal folgendes:
Öffne die functions.php und suche nach
if ($exif) {
füge dannach einecho "exif";
lösche den Teil
$exif = exif_read_data ($media_src,0,true);
foreach($exif as $key=>$section) {
if (($key == "IFD0") || ($key == "EXIF")) {
foreach($section as $name=>$val) {
if (!(exif_filter($name)) && exif_filter_control()) continue;
$row_bg_number = ($bgcounter++ % 2 == 0) ? 1 : 2;
$site_template->register_vars(array(
"exif_value" => exif_parse_value($name, $val),
"exif_name" => $name . ":",
"row_bg_number" => $row_bg_number
));
$exif_info .= $site_template->parse_template("exif_bit");
}
}
oder kommentiere das mal aus.
Dann sehen wir erst mal, ob der eigentliche Part "EXIF würde ermittelt" ausgeführt werden würde (Du müßtest das Wort EXIF oben am Bildrant sehen) und, ob "der" an der weißen Seite beteiligt ist (weil die dann eben nicht kommt) - dann grenzen wir das weiter ein...
Henry
-
@henary
ich habe es getan und habe den exif text oben in der ecke wobei ich
$exif_info .= $site_template->parse_template("exif_bit");
}
}
}
}
wobei ich nicht nur 2 } klammern ausklammern musste sonder 4 }
gruss
vincent
-
@henary
vielen Dank - jetzt funktioniert es wunderbar
gruss
vincent
-
Morgen!
Ich hätte eine große bitte an euch, ich verfolge diesen tread schon etwas länger und habe auch immer versucht meine hompage (4images) zu modifizieren so das die exif's angezeigt werden, leider immer erfolglos, da ich von php und den ganzen drumherum wenig ahnung habe.
könnte irgenwer diese änderungen die man vornehmen muß damit es funktioniert, einmal wieder zusammenfassen so das auch ein ahnungsloser wie ich das versteht :)
mfg Andi
-
Hallo !
Ich bekomme keine EXIF Daten in der details.html angezeigt.
Habe alle Dateien lt. Anleitung geändert bzw. in die Verzeichnisse kopiert.
lt phpinfo ist exif enabled
Kann es sein das die Exif Daten beim Upload irgendwie "verloren" gehen. Ich hab einfach keine andere Erklärung mehr. Übrigen IPTC Daten werden auch nicht angezeigt.
Hier noch ein paar auszüge aus phpinfo
'--enable-exif' '--enable-ftp' '--enable-magic-quotes' '--enable-safe-mode' '--enable-sockets'
EXIF Support enabled
EXIF Version 1.4 $Id: exif.c,v 1.118.2.29 2004/11/10 01:44:58 iliaa Exp $
Supported EXIF Version 0220
Supported filetypes JPEG,TIFF
Bitte um Hilfe ! (hab schon einen ganzen Nachmittag versch***)
Meine Galerie : http://www.hildner.at/4images
mfG
Martin
Nachtrag: Bin jetzt draufgekommen, dass die IPTC und EXIF Daten NUR beim Upload aus dem Control Panel mitgeladen werden.
Beim Upload per FTP und anschließenden "Neue Bilder checken" werden keine Daten angezeigt(auch wenn ich Insert IPTC Values anklicke) , und auch nicht beim Upload aus der Galerie selbst ?????
-
@martin150
http://www.foto-kocher.biz/details.php?image_id=4271
nun wie es schein hast du einfach keine IPTC und EXIF Informationen!
oder stell mal ein original Bild zur verfügung!
gruss
vincent
-
Hallo !
Dieses Bild hat tatsächlich keine EXIF!
Aber bei Bildern mit EXIF:
Exif und IPTC Daten werden nur angezeigt wenn ich das Bild im ControlPanel unter "Bilder hinzufügen" upgeloadet wird.
Bei jeder anderen Variante (Upload per FTP und "neue Bilder checken oder Upload aus der Galerie selbst) werden keine IPTC oder EXIF Daten angezeigt ???????
mfG
Martin
-
nun dann muss ich annehmen das ein Grafikkonverter diese löscht!
Ich habe dieses Tool um nach einem FTP upload die files zu checken
http://www.4homepages.de/forum/index.php?topic=4754.0
gruss
vincent
-
Hallo !
Danke erstmal für deine Antworten !!
Diesen Mod verwende ich auch !!
Ich glaube Annotation heißt das Zauberwort ! Bei Einfügen eines Wasserzeichens gehen die EXIF Daten verloren ! Ebenso wenn ich beim "Check new images" die Funktion "Image Resizer" auf on schalte !!
Beides "frißt" die Exif !
Fazit: Nur Bilder in der richtigen Größe hochladen und das Wasserzeichen in einem anderen Programm einfügen !
Wär halt anders bequemer gewesen :-(
mfG
Martin
-
gemäss V@no sollte es aber gehen
vielleich im check new image MOD anfragen!
gruss
vincent
-
I tried installing this script about a week ago and ended up getting nothing but a blank white screen. I tried again, this time only using the script in fatman's very first post. This time the gallery shows up, but when you click on an image, I get the blank screen again. What do I do now?
I'm using Firefox 1.0.7
My gallery is located here:
http://images.netcot.com
(direct link to a specific page: http://images.netcot.com/categories.php?cat_id=1 (http://images.netcot.com/categories.php?cat_id=1)
Please keep in mind my knowledge of php is real limited. I read other replies saying "check the error log." I have no idea what that is, where to find it, or how to check it!
-
You may have an error in the script -- maybe a SPACE after the closing php> at end of file
-
Thanks for the response. There was no space after the closing php tag inside the functions.php page.
-
Oh!!! I miss one "}"
there should be seven "}" at the end
$exif_info .= $site_template->parse_template("exif_bit");
}
}
}
}
}
}
}
I noticed if I do this step, the entire gallery does not show up. So I switched my code back to SIX "}" and I can see my gallery now. The full size image still does not work.
-
I think I found my error.log in my control panel. Here's what I found:
[Mon Oct 3 00:33:34 2005] [error] PHP Fatal error: Call to undefined function: exif_read_data() in /home/netcot/public_html/images/includes/functions.php on line 396
Here's what's on line 396:
$exif = exif_read_data ($media_src,'IFD0');
-
that seems as if the exif-moduke is not included in your php-installation - ask your provider please
-
Thanks! That's all I needed. My provider was able to add support for EXIF. THANK YOU!!!!!
-
i keep getting this error on my details page the main gallery still works though
Fatal error: Call to undefined function: exif_read_data() in /home/artpictu/public_html/gallery/includes/functions.php on line 416
is this a server issue or my codeing
RT
-
okay so exif is enabled at the server
"Hello,
Exif module is complied on the server with apache, it is working fine.
If you have any more problems or questions please let us know.
Thank you.
"
so can anyone else help me use this mod
-
"Hello,
Exif module is complied on the server with apache, it is working fine.
If you have any more problems or questions please let us know.
Thank you.
"
doh! another "no problem on our side" issue...
acording the error message, exif is NOT ENABLED in php...
if you look in phpinfo of your server, can you see any references for exif?
-
"doh! another "no problem on our side" issue...
acording the error message, exif is NOT ENABLED in php...
if you look in phpinfo of your server, can you see any references for exif?
Thanks V@nothe host just asked if i wanted exif compiled, you was right thanks will give the mod another try :D
-
:D thank you it now works thanks to you V@no great stuff, :D
-
Hallo ich bekomme die Fehlermeldung:
Parse error: parse error, unexpected '}' in /mnt/ja2/07/460/00000013/htdocs/Album/includes/functions.php on line 835
meine Quelltexte sehen so aus:
Functions.php
<?php
/**************************************************************************
* *
* 4images - A Web Based Image Gallery Management System *
* ---------------------------------------------------------------- *
* *
* File: functions.php *
* Copyright: (C) 2002 Jan Sorgalla *
* Email: jan@4homepages.de *
* Web: http://www.4homepages.de *
* Scriptversion: 1.7 *
* *
* Never released without support from: Nicky (http://www.nicky.net) *
* *
**************************************************************************
* *
* Dieses Script ist KEINE Freeware. Bitte lesen Sie die Lizenz- *
* bedingungen (Lizenz.txt) für weitere Informationen. *
* --------------------------------------------------------------- *
* This script is NOT freeware! Please read the Copyright Notice *
* (Licence.txt) for further information. *
* *
*************************************************************************/
if (!defined('ROOT_PATH')) {
die("Security violation");
}
include(ROOT_PATH.'includes/exif.php');
function get_gallery_image($image_name) {
global $config;
if (file_exists(TEMPLATE_PATH."/images_".$config['language_dir']."/".$image_name)) {
return TEMPLATE_PATH."/images_".$config['language_dir']."/".$image_name;
}
else {
return TEMPLATE_PATH."/images/".$image_name;
}
}
function is_remote($file_name) {
return (preg_match('#^https?\\:\\/\\/[a-z0-9\-]+\.([a-z0-9\-]+\.)?[a-z]+#i', $file_name)) ? 1 : 0;
}
function is_remote_file($file_name) {
return (preg_match("#^(https?:\/\/[a-z0-9\-]+?\.([a-z0-9\-]+\.)*[a-z]+(:[0-9]+)*\/.*?\.([a-z]{1,4})$)#is", $file_name)) ? 1 : 0;
}
function is_local_file($file_name) {
return (preg_match("#^((\.)*\/.*?\.([a-z]{1,4})$)#is", $file_name)) ? 1 : 0;
}
function check_remote_media($remote_media_file) {
global $config;
return (preg_match("#^(https?:\/\/[a-z0-9\-]+?\.([a-z0-9\-]+\.)*[a-z]+(:[0-9]+)*\/.*?\.(".$config['allowed_mediatypes_match'].")$)#is", $remote_media_file)) ? 1 : 0;
}
function check_local_media($local_media_file) {
global $config;
return (preg_match("#^((\.)*\/.*?\.(".$config['allowed_mediatypes_match'].")$)#is", $local_media_file)) ? 1 : 0;
}
function check_remote_thumb($remote_thumb_file) {
return (preg_match("#^(https?:\/\/[a-z0-9\-]+?\.([a-z0-9\-]+\.)*[a-z]+(:[0-9]+)*\/.*?\.(gif|jpg|jpeg|png)$)#is", $remote_thumb_file)) ? 1 : 0;
}
function check_local_thumb($remote_thumb_file) {
return (preg_match("#^((\.)*\/.*?\.(gif|jpg|jpeg|png)$)#is", $remote_thumb_file)) ? 1 : 0;
}
function get_file_extension($file_name) {
ereg("(.+)\.(.+)", basename($file_name), $regs);
return strtolower($regs[2]);
}
function get_file_name($file_name) {
ereg("(.+)\.(.+)", basename($file_name), $regs);
return $regs[1];
}
function check_media_type($file_name) {
global $config;
return (in_array(get_file_extension($file_name), $config['allowed_mediatypes_array'])) ? 1 : 0;
}
function check_thumb_type($file_name) {
return (preg_match("#(gif|jpg|jpeg|png)$#is", $file_name)) ? 1 : 0;
}
function check_executable($file_name) {
if (substr(PHP_OS, 0, 3) == "WIN" && !eregi("\.exe$", $file_name)) {
$file_name .= ".exe";
}
elseif (substr(PHP_OS, 0, 3) != "WIN") {
$file_name = eregi_replace("\.exe$", "", $file_name);
}
return $file_name;
}
function get_file_path($file_name = "", $image_type = "media", $cat_id = 0, $in_admin = 0, $return_icon = 1, $check_remote = CHECK_REMOTE_FILES) {
$return_code = ($return_icon) ? ICON_PATH."/404.gif" : 0;
if (empty($file_name)) {
return $return_code;
}
if (is_remote($file_name)) {
$check_handle = "check_remote_".$image_type;
return ($check_handle($file_name) && remote_file_exists($file_name, $check_remote)) ? (($in_admin && !preg_match("#(gif|jpg|jpeg|png)$#is", $file_name)) ? ICON_PATH."/".get_file_extension($file_name).".gif" : $file_name) : $return_code;
}
elseif (is_local_file($file_name)) {
$check_handle = "check_local_".$image_type;
$file_name = ($in_admin && preg_match("/^([\.]+|[^\/])/", $file_name)) ? "../".$file_name : $file_name;
if (!file_exists($file_name)) {
$file_path = preg_replace("/\/{2,}/", "/", get_document_root()."/".$file_name);
return ($check_handle($file_name) && file_exists($file_path)) ? (($in_admin && !preg_match("#(gif|jpg|jpeg|png)$#is", $file_name)) ? ICON_PATH."/".get_file_extension($file_name).".gif" : $file_name) : $return_code;
}
else {
return $file_name;
}
}
else {
$check_handle = "check_".$image_type."_type";
$path = (($image_type == "media") ? (($cat_id) ? MEDIA_PATH."/".$cat_id : MEDIA_TEMP_PATH) : (($cat_id) ? THUMB_PATH."/".$cat_id : THUMB_TEMP_PATH))."/".$file_name;
return ($check_handle($file_name) && file_exists($path)) ? (($in_admin && !preg_match("#(gif|jpg|jpeg|png)$#is", $file_name)) ? ICON_PATH."/".get_file_extension($file_name).".gif" : $path) : $return_code;
}
}
function un_htmlspecialchars($chars) {
//$chars = preg_replace("/(&#)([0-9]*)(;)/esiU", "chr(intval('\\2'))", $chars);
$chars = str_replace(">", ">", $chars);
$chars = str_replace("<", "<", $chars);
$chars = str_replace(""", "\"", $chars);
$chars = str_replace("&", "&", $chars);
return $chars;
}
function get_iptc_info($info) {
$iptc_match = array();
$iptc_match['2#120'] = "caption";
$iptc_match['2#122'] = "caption_writer";
$iptc_match['2#105'] = "headline";
$iptc_match['2#040'] = "special_instructions";
$iptc_match['2#080'] = "byline";
$iptc_match['2#085'] = "byline_title";
$iptc_match['2#110'] = "credit";
$iptc_match['2#115'] = "source";
$iptc_match['2#005'] = "object_name";
$iptc_match['2#055'] = "date_created";
$iptc_match['2#090'] = "city";
$iptc_match['2#095'] = "state";
$iptc_match['2#101'] = "country";
$iptc_match['2#103'] = "original_transmission_reference";
$iptc_match['2#015'] = "category";
$iptc_match['2#020'] = "supplemental_category";
$iptc_match['2#025'] = "keyword";
$iptc_match['2#116'] = "copyright_notice";
$iptc = iptcparse($info);
$iptc_array = array();
if (is_array($iptc)) {
foreach ($iptc as $key => $val) {
if (isset($iptc_match[$key])) {
$iptc_info = "";
foreach ($val as $val2) {
$iptc_info .= (($iptc_info != "" ) ? ", " : "").$val2;
}
if ($key == "2#055") {
$iptc_array[$iptc_match[$key]] = preg_replace("/([0-9]{4})([0-9]{2})([0-9]{2})/", "\\3.\\2.\\1", $iptc_info);
}
else {
$iptc_array[$iptc_match[$key]] = replace_url($iptc_info);
}
}
}
}
return $iptc_array;
}
function show_image($image_row, $mode = "", $show_link = 1, $detailed_view = 0) {
global $self_url, $site_template, $site_sess, $user_info, $config, $cat_cache, $lang, $additional_image_fields, $user_table_fields, $url_show_profile;
$is_new = ($image_row['image_date'] >= (time() - 60 * 60 * 24 * $config['new_cutoff'])) ? 1 : 0;
$description = (!empty($image_row['image_description'])) ? format_text($image_row['image_description'], 1) : REPLACE_EMPTY;
if (!empty($image_row['image_keywords'])) {
$split_keywords = explode(" ", $image_row['image_keywords']);
$keywords = "";
foreach ($split_keywords as $key => $val) {
$keywords .= (($keywords != "" ) ? ", " : "")."<a href=\"".$site_sess->url(ROOT_PATH."search.php?search_keywords=".urlencode($val))."\">$val</a>";
}
}
else {
$keywords = REPLACE_EMPTY;
}
if (!check_permission("auth_readcomment", $image_row['cat_id'])) {
$image_row['image_allow_comments'] = 0;
}
$num_comments = ($image_row['image_allow_comments'] == 1) ? $image_row['image_comments'] : "";
if ($user_info['user_level'] != GUEST) {
$lightbox_url = $self_url;
$lightbox_url .= (!empty($mode)) ? ((preg_match("/\?/", $lightbox_url)) ? "&" : "?")."mode=".$mode : "";
$lightbox_url .= preg_match("/\?/", $lightbox_url) ? "&" : "?";
if (check_lightbox($image_row['image_id'])) {
$lightbox_url .= "action=removefromlightbox&id=".$image_row['image_id'];
$lightbox_button = "<a href=\"".$site_sess->url($lightbox_url)."\"><img src=\"".get_gallery_image("lightbox_yes.gif")."\" border=\"0\" alt=\"\" /></a>";
}
else {
$lightbox_url .= "action=addtolightbox&id=".$image_row['image_id'];
$lightbox_button = "<a href=\"".$site_sess->url($lightbox_url)."\"><img src=\"".get_gallery_image("lightbox_no.gif")."\" border=\"0\" alt=\"\" /></a>";
}
}
else {
$lightbox_button = "<img src=\"".get_gallery_image("lightbox_off.gif")."\" border=\"0\" alt=\"\" />";
}
if (!check_permission("auth_download", $image_row['cat_id'])) {
$download_button = "<img src=\"".get_gallery_image("download_off.gif")."\" border=\"0\" alt=\"\" />";
$download_zip_button = (function_exists("gzcompress") && function_exists("crc32")) ? "<img src=\"".get_gallery_image("download_zip_off.gif")."\" border=\"0\" alt=\"\" />" : "";
$allow_download = 0;
}
else {
$target = (!empty($image_row['image_download_url']) && !is_remote_file($image_row['image_download_url']) && !is_local_file($image_row['image_download_url'])) ? "target=\"_blank\"" : "";
$download_button = "<a href=\"".$site_sess->url(ROOT_PATH."download.php?".URL_IMAGE_ID."=".$image_row['image_id'])."\"".$target."><img src=\"".get_gallery_image("download.gif")."\" border=\"0\" alt=\"\" /></a>";
$download_zip_button = ($target == "" && function_exists("gzcompress") && function_exists("crc32")) ? "<a href=\"".$site_sess->url(ROOT_PATH."download.php?action=zip&".URL_IMAGE_ID."=".$image_row['image_id'])."\"".$target."><img src=\"".get_gallery_image("download_zip.gif")."\" border=\"0\" alt=\"\" /></a>" : "";
$allow_download = 1;
}
if (!check_permission("auth_sendpostcard", $image_row['cat_id'])) {
$postcard_button = "<img src=\"".get_gallery_image("postcard_off.gif")."\" border=\"0\" alt=\"\" />";
}
else {
$postcard_button = "<a href=\"".$site_sess->url(ROOT_PATH."postcards.php?".URL_IMAGE_ID."=".$image_row['image_id'].((!empty($mode)) ? "&mode=".$mode : ""))."\"><img src=\"".get_gallery_image("postcard.gif")."\" border=\"0\" alt=\"\" /></a>";
}
if (!check_permission("auth_viewimage", $image_row['cat_id']) || !check_permission("auth_viewcat", $image_row['cat_id'])) {
$show_link = 0;
}
$file_size = "n/a";
if (!is_remote($image_row['image_media_file'])) {
if ($file_size = @filesize(MEDIA_PATH."/".$image_row['cat_id']."/".$image_row['image_media_file'])) {
$file_size = format_file_size($file_size);
}
}
elseif ($detailed_view) {
$file_size = get_remote_file_size($image_row['image_media_file']);
}
if (isset($image_row[$user_table_fields['user_name']]) && $image_row['user_id'] != GUEST) {
$user_name = $image_row[$user_table_fields['user_name']];
$user_profile_link = (!empty($url_show_profile)) ? preg_replace("/{user_id}/", $image_row['user_id'], $url_show_profile) : ROOT_PATH."member.php?action=showprofile&".URL_USER_ID."=".$image_row['user_id'];
$user_name_link = "<a href=\"".$site_sess->url($user_profile_link)."\">".$user_name."</a>";
}
else {
$user_name = $lang['userlevel_guest'];
$user_name_link = $user_name;
}
$site_template->register_vars(array(
"image_id" => $image_row['image_id'],
"user_id" => $image_row['user_id'],
"user_name" => $user_name,
"user_name_link" => $user_name_link,
"image_name" => $image_row['image_name'],
"image_description" => $description,
"image_keywords" => $keywords,
"image_date" => format_date($config['date_format']." ".$config['time_format'],$image_row['image_date']),
"image_is_new" => $is_new,
"lang_new" => $lang['new'],
"image_active" => $image_row['image_active'],
"cat_id" => $image_row['cat_id'],
"cat_name" => $image_row['cat_name'],
"cat_url" => $site_sess->url(ROOT_PATH."categories.php?".URL_CAT_ID."=".$image_row['cat_id']),
"image_downloads" => $image_row['image_downloads'],
"image_votes" => $image_row['image_votes'],
"image_rating" => $image_row['image_rating'],
"image_hits" => $image_row['image_hits'],
"allow_comments" => $image_row['image_allow_comments'],
"lang_comments" => $lang['comments'],
"image_comments" => $num_comments,
"lightbox_button" => $lightbox_button,
"postcard_button" => $postcard_button,
"download_button" => $download_button,
"download_zip_button" => $download_zip_button,
"image_download_url" => $image_row['image_download_url'],
"allow_download" => $allow_download,
"url_download" => $site_sess->url(ROOT_PATH."download.php?".URL_IMAGE_ID."=".$image_row['image_id']),
"image_file_size" => $file_size,
"image" => get_media_code($image_row['image_media_file'], $image_row['image_id'], $image_row['cat_id'], $image_row['image_name'], $mode, $show_link, $detailed_view),
"thumbnail" => get_thumbnail_code($image_row['image_media_file'], $image_row['image_thumb_file'], $image_row['image_id'], $image_row['cat_id'], $image_row['image_name'], $mode, $show_link),
"thumbnail_openwindow" => get_thumbnail_code($image_row['image_media_file'], $image_row['image_thumb_file'], $image_row['image_id'], $image_row['cat_id'], $image_row['image_name'], $mode, $show_link, 1),
"image_file_name" => $image_row['image_media_file'],
"thumbnail_file_name" => $image_row['image_thumb_file']
));
if (!empty($additional_image_fields)) {
$additional_field_array = array();
foreach ($additional_image_fields as $key => $val) {
$additional_field_array[$key] = (!empty($image_row[$key])) ? format_text($image_row[$key], 1) : REPLACE_EMPTY;
$additional_field_array['lang_'.$key] = $val[0];
}
if (!empty($additional_field_array)) {
$site_template->register_vars($additional_field_array);
}
}
$rate_form = "";
if (check_permission("auth_vote", $image_row['cat_id'])) {
$site_template->register_vars("rate", $lang['rate']);
$rate_form = $site_template->parse_template("rate_form");
}
$site_template->register_vars("rate_form", $rate_form);
return true;
}
function get_thumbnail_code($media_file_name, $thumb_file_name = "", $image_id, $cat_id, $image_name = "", $mode = "", $show_link = 1, $open_window = 0) {
global $site_sess, $config;
if (!check_media_type($media_file_name)) {
$thumb = "<img src=\"".ICON_PATH."/404.gif\" border=\"0\" alt=\"\" />";
}
else {
if (!get_file_path($thumb_file_name, "thumb", $cat_id, 0, 0)) {
$file_src = ICON_PATH."/".get_file_extension($media_file_name).".gif";
$image_info = @getimagesize($dummy);
$width_height = (!empty($image_info[3])) ? " ".$image_info[3] : "";
$thumb = "<img src=\"".$file_src."\" border=\"0\"".$width_height." alt=\"".$image_name."\" />";
}
else {
$file_src = get_file_path($thumb_file_name, "thumb", $cat_id, 0, 1);
$image_info = @getimagesize($file_src);
$width_height = (!empty($image_info[3])) ? " ".$image_info[3] : "";
$thumb = "<img src=\"".$file_src."\" border=\"".$config['image_border']."\"".$width_height." alt=\"".$image_name."\" />";
}
}
if ($show_link) {
if ($open_window) {
$thumb = "<a href=\"".$site_sess->url(ROOT_PATH."details.php?".URL_IMAGE_ID."=".$image_id.((!empty($mode)) ? "&mode=".$mode : ""))."\" onclick=\"opendetailwindow()\" target=\"detailwindow\">".$thumb."</a>";
}
else {
$thumb = "<a href=\"".$site_sess->url(ROOT_PATH."details.php?".URL_IMAGE_ID."=".$image_id.((!empty($mode)) ? "&mode=".$mode : ""))."\">".$thumb."</a>";
}
}
return $thumb;
}
function get_media_code($media_file_name, $image_id = 0, $cat_id = 0, $image_name = "", $mode = "", $show_link = 0, $detailed_view = 0) {
global $site_template, $site_sess, $lang, $mode;
if (!get_file_path($media_file_name, "media", $cat_id, 0, 0)) {
$media = "<img src=\"".ICON_PATH."/404.gif\" border=\"0\" alt=\"\" />";
$site_template->register_vars("iptc_info", "");
}
else {
$media_src = get_file_path($media_file_name, "media", $cat_id, 0, 1);
$file_extension = get_file_extension($media_file_name);
$media_icon = "<img src=\"".ICON_PATH."/".$file_extension.".gif\" border=\"0\" alt=\"".$image_name."\" />";
if ($show_link) {
$media_icon = "<a href=\"".$site_sess->url(ROOT_PATH."details.php?".URL_IMAGE_ID."=".$image_id.((!empty($mode)) ? "&mode=".$mode : ""))."\">".$media_icon."</a>";
}
$width_height = "";
$width = "";
$height = "";
$iptc_info = "";
$src = (!file_exists($media_src) && file_exists(preg_replace("/\/{2,}/", "/", get_document_root()."/".$media_src))) ? preg_replace("/\/{2,}/", "/", get_document_root()."/".$media_src) : $media_src;
if ($image_info = @getimagesize($src, $info)) {
$width_height = " ".$image_info[3];
$width = $image_info[0];
$height = $image_info[1];
if ($detailed_view && isset($info['APP13'])) {
$iptc_array = get_iptc_info($info['APP13']);
$bgcounter = 0;
foreach ($iptc_array as $key => $val) {
$row_bg_number = ($bgcounter++ % 2 == 0) ? 1 : 2;
$site_template->register_vars(array(
"iptc_value" => $val,
"iptc_name" => $lang['iptc_'.$key],
"row_bg_number" => $row_bg_number
));
$iptc_info .= $site_template->parse_template("iptc_bit");
}
}
define('BACKUPDIR', "/home/huellasp/public_html/4images/backupimages");
$exif_info = "";
$src_backup = BACKUPDIR."/".$cat_id."/".$media_file_name;
if ((($file_extension == "jpg") || ($file_extension == "jpeg")) &&($detailed_view)) {
$exif = exif_read_data ($src_backup,'IFD0');
$bgcounter = 0;
if ($exif) {
$exif = exif_read_data ($src_backup,0,true);
foreach($exif as $key=>$section) {
if (($key == "IFD0") || ($key == "EXIF")) {
foreach($section as $name=>$val) {
if (!(exif_filter($name)) && exif_filter_control()) continue;
$row_bg_number = ($bgcounter++ % 2 == 0) ? 1 : 2;
$site_template->register_vars(array(
"exif_value" => exif_parse_value($name, $val),
"exif_name" => $name . ":",
"row_bg_number" => $row_bg_number
));
$exif_info .= $site_template->parse_template("exif_bit");
}
}
}
}
}
}
$site_template->register_vars(array(
"media_src" => $media_src,
"media_icon" => $media_icon,
"image_name" => $image_name,
"width_height" => $width_height,
"width" => $width,
"height" => $height,
"iptc_info" => $iptc_info,
"exif_info" => $exif_info
));
$media = $site_template->parse_template("media/".$file_extension);
}
return $media;
}
function get_random_image_cache() {
global $site_db, $cat_cache, $total_images;
$random_image_cache = array();
$cat_id_sql = get_auth_cat_sql("auth_viewcat", "NOTIN");
if (SHOW_RANDOM_CAT_IMAGE) {
$sql = "SELECT DISTINCT i.image_id, i.cat_id, i.user_id, i.image_name, i.image_description, i.image_keywords, i.image_date, i.image_active, i.image_media_file, i.image_thumb_file, i.image_download_url, i.image_allow_comments, i.image_comments, i.image_downloads, i.image_votes, i.image_rating, i.image_hits, c.cat_name".get_user_table_field(", u.", "user_name")."
FROM ".IMAGES_TABLE." i, ".CATEGORIES_TABLE." c
LEFT JOIN ".USERS_TABLE." u ON (".get_user_table_field("u.", "user_id")." = i.user_id)
WHERE i.image_active = 1 AND i.cat_id NOT IN ($cat_id_sql) AND c.cat_id = i.cat_id
ORDER BY RAND()";
$result = $site_db->query($sql);
while ($row = $site_db->fetch_array($result)) {
$random_image_cache[$row['cat_id']] = $row;
}
}
else {
if (empty($total_images)) {
$sql = "SELECT COUNT(*) as total_images
FROM ".IMAGES_TABLE."
WHERE image_active = 1 AND cat_id NOT IN ($cat_id_sql)";
$row = $site_db->query_firstrow($sql);
$total_images = $row['total_images'];
}
if (empty($total_images)) {
return $random_image_cache;
}
mt_srand((double)microtime() * 1000000);
$number = ($total_images > 1) ? mt_rand(0, $total_images - 1) : 0;
$sql = "SELECT i.image_id, i.cat_id, i.user_id, i.image_name, i.image_description, i.image_keywords, i.image_date, i.image_active, i.image_media_file, i.image_thumb_file, i.image_download_url, i.image_allow_comments, i.image_comments, i.image_downloads, i.image_votes, i.image_rating, i.image_hits, c.cat_name".get_user_table_field(", u.", "user_name")."
FROM ".IMAGES_TABLE." i, ".CATEGORIES_TABLE." c
LEFT JOIN ".USERS_TABLE." u ON (".get_user_table_field("u.", "user_id")." = i.user_id)
WHERE i.image_active = 1 AND i.cat_id NOT IN ($cat_id_sql) AND c.cat_id = i.cat_id
LIMIT $number, 1";
$random_image_cache[0] = $site_db->query_firstrow($sql);
}
return $random_image_cache;
}
function get_random_image($cat_id = 0, $show_link = 1, $return_file = 0) {
global $site_template, $random_image_cache;
if (!isset($random_image_cache)) {
$random_image_cache = get_random_image_cache();
}
if ($cat_id && SHOW_RANDOM_CAT_IMAGE) {
$template = 'random_cat_image';
$category_id = $cat_id;
}
else {
$template = 'random_image';
if (SHOW_RANDOM_CAT_IMAGE) {
srand((float)microtime() * 1000000);
$category_id = array_rand($random_image_cache);
}
else {
$category_id = 0;
}
}
if (!empty($random_image_cache[$category_id])) {
if (!$return_file) {
show_image($random_image_cache[$category_id], "", $show_link);
$random_image = $site_template->parse_template($template);
return $random_image;
}
else {
return get_file_path($random_image_cache[$category_id]['image_thumb_file'], "thumb", $category_id, 0, 1);
}
}
}
function format_file_size($file_size = 0) {
$file_size = intval($file_size);
if (!$file_size) {
return "n/a";
}
if (strlen($file_size) <= 9 && strlen($file_size) >= 7) {
$file_size = number_format($file_size / 1048576,1);
return $file_size." MB";
}
elseif (strlen($file_size) >= 10) {
$file_size = number_format($file_size / 1073741824,1);
return $file_size." GB";
}
else {
$file_size = number_format($file_size / 1024,1);
return $file_size." KB";
}
}
function get_remote_file_size($file_path) {
ob_start();
@readfile($file_path);
$file_data = ob_get_contents();
ob_end_clean();
return format_file_size(strlen($file_data));
}
function update_comment_count($image_id = 0, $user_id = 0) {
global $site_db, $user_table_fields;
if ($image_id) {
$sql = "SELECT COUNT(comment_id) AS comments
FROM ".COMMENTS_TABLE."
WHERE image_id = $image_id";
$countcomments = $site_db->query_firstrow($sql);
$sql = "UPDATE ".IMAGES_TABLE."
SET image_comments = ".$countcomments['comments']."
WHERE image_id = $image_id";
$site_db->query($sql);
}
if ($user_id != GUEST && $user_id && !empty($user_table_fields['user_comments'])) {
$sql = "SELECT COUNT(comment_id) AS comments
FROM ".COMMENTS_TABLE."
WHERE user_id = $user_id";
$countcomments = $site_db->query_firstrow($sql);
$sql = "UPDATE ".USERS_TABLE."
SET ".get_user_table_field("", "user_comments")." = ".$countcomments['comments']."
WHERE ".get_user_table_field("", "user_id")." = $user_id";
$site_db->query($sql);
}
}
function update_image_rating($image_id, $rating) {
global $site_db;
$sql = "SELECT cat_id, image_votes, image_rating
FROM ".IMAGES_TABLE."
WHERE image_id = $image_id";
$image_row = $site_db->query_firstrow($sql);
if (check_permission("auth_vote", $image_row['cat_id'])) {
$old_votes = $image_row['image_votes'];
$old_rating = $image_row['image_rating'];
$new_rating = (($old_rating * $old_votes) + $rating) / ($old_votes + 1);
$new_rating = sprintf("%.2f", $new_rating);
$sql = "UPDATE ".IMAGES_TABLE."
SET image_votes = ($old_votes + 1), image_rating = '$new_rating'
WHERE image_id = $image_id";
$site_db->query($sql);
}
}
function check_email($email) {
return (preg_match('/^[-!#$%&\'*+\\.\/0-9=?A-Z^_`{|}~]+@([-0-9A-Z]+\.)+([0-9A-Z]){2,4}$/i', $email)) ? 1 : 0;
}
function format_date($format, $timestamp) {
global $user_info;
$timezone_offset = (defined("TIME_OFFSET")) ? TIME_OFFSET : 0;
return date($format, $timestamp + (3600 * $timezone_offset));
}
function format_url($url) {
if (!preg_match("/^http:\/\//i", $url)) {
$url = "http://".$url;
}
if (!preg_match("/^https?\\:\\/\\/[a-z0-9\-]+\.([a-z0-9\-]+\.)?[a-z]+/i", $url)) {
$url = "";
}
return $url;
}
function replace_url($text) {
$text = " ".$text." ";
$url_search_array = array(
"#([^]_a-z0-9-=\"'\/])([a-z]+?)://([^, \(\)<>\n\r]+)#si",
"#([^]_a-z0-9-=\"'\/])www\.([a-z0-9\-]+)\.([a-z0-9\-.\~]+)((?:/[^, \(\)<>\n\r]*)?)#si"
);
$url_replace_array = array(
"\\1<a href=\"\\2://\\3\" target=\"_blank\">\\2://\\3</a>",
"\\1<a href=\"http://www.\\2.\\3\\4\" target=\"_blank\">www.\\2.\\3\\4</a>"
);
$text = preg_replace($url_search_array, $url_replace_array, $text);
if (strpos($text, "@")) {
$text = preg_replace("#([\n ])([a-z0-9\-_.]+?)@([\w\-]+\.([\w\-\.]+\.)?[\w]+)#i", "\\1<a href=\"mailto:\\2@\\3\">\\2@\\3</a>", $text);
}
return trim($text);
}
function replace_badwords($text) {
global $config, $split_badwords;
if ($config['badword_list'] != "") {
if (!isset($split_badwords)) {
$badwords = trim($config['badword_list']);
$badwords = preg_replace("/[\n\r]/is", " ", $badwords);
$badwords = str_replace(","," ",$badwords);
$badwords = preg_quote($badwords);
$badwords = str_replace('/', '\\/', $badwords);
$split_badwords = preg_split("/\s+/", $badwords);
}
foreach ($split_badwords as $key => $val) {
if ($val != "") {
if (substr($val, 0, 2) == "\\{") {
$val = substr($val, 2, -2);
$text = trim(preg_replace("/([^A-Za-z])".$val."(?=[^A-Za-z])/si", "\\1".str_repeat($config['badword_replace_char'], strlen($val)), " $text "));
}
else {
$text = trim(preg_replace("/$val/si", str_repeat($config['badword_replace_char'], strlen($val)), " $text "));
}
}
}
}
return $text;
}
function format_text($text, $html = 0, $word_wrap = 0, $bbcode = 0, $bbcode_img = 0) {
$text = trim($text);
if ($word_wrap && $text != "") {
$text = preg_replace("/([^\n\r ?&\.\/<>\"\\-]{".$word_wrap."})/i", " \\1\n", $text);
}
if ($html == 0) {
$text = str_replace("<", "&lt;", $text);
$text = str_replace(">", "&gt;", $text);
$text = str_replace("<", "<", $text);
$text = str_replace(">", ">", $text);
}
$text = str_replace("\n", "<br />", $text);
$text = replace_url($text);
if ($bbcode == 1) {
$search_array = array(
"/(\[)(list)(=)(['\"]?)([^\"']*)(\\4])(.*)(\[\/list)(((=)(\\4)([^\"']*)(\\4]))|(\]))/siU",
"/(\[)(list)(])(.*)(\[\/list\])/siU",
"/(\[\*\])/siU",
"/(\[)(url)(=)(['\"]?)(www\.)([^\"']*)(\\4])(.*)(\[\/url\])/siU",
"/(\[)(url)(=)(['\"]?)([^\"']*)(\\4])(.*)(\[\/url\])/siU",
"/(\[)(url)(])(www\.)([^\"]*)(\[\/url\])/siU",
"/(\[)(url)(])([^\"]*)(\[\/url\])/siU",
"/(\[)(code)(])(\r\n)*(.*)(\[\/code\])/siU",
"/javascript:/si",
"/about:/si"
);
$replace_array = array(
"<ol type=\"\\5\">\\7</ol>",
"<ul>\\4</ul>",
"<li>",
"<a href=\"http://www.\\6\" target=\"_blank\">\\8</a>",
"<a href=\"\\5\" target=\"_blank\">\\7</a>",
"<a href=\"http://www.\\5\" target=\"_blank\">www.\\5</a>",
"<a href=\"\\4\" target=\"_blank\">\\4</a>",
"<pre>Code:<hr size=1>\\5<hr size=1></pre>",
"java script:",
"about :"
);
$text = preg_replace($search_array, $replace_array, $text);
if (!$bbcode_img) {
$text = preg_replace("/(\[)(img)(])(\r\n)*([^\"]*)(\[\/img\])/siU", "<a href=\"\\5\" target=\"_blank\">\\5</a>", $text);
}
else {
$text = preg_replace("/(\[)(img)(])(\r\n)*([^\"]*)(\[\/img\])/siU", "<img src=\"\\5\">", $text);
}
$text = preg_replace("/(\[)(b)(])(\r\n)*([^\"]*)(\[\/b\])/siU", "<b>\\5</b>", $text);
$text = preg_replace("/(\[)(i)(])(\r\n)*([^\"]*)(\[\/i\])/siU", "<i>\\5</i>", $text);
$text = preg_replace("/(\[)(u)(])(\r\n)*([^\"]*)(\[\/u\])/siU", "<u>\\5</u>", $text);
}
$text = str_replace("\\'", "'", $text);
return replace_badwords($text);
}
function get_user_info($user_id = 0) {
global $site_db, $user_table_fields;
$user_info = 0;
if ($user_id != 0 && $user_id != GUEST) {
$sql = "SELECT *
FROM ".USERS_TABLE."
WHERE ".get_user_table_field("", "user_id")." = $user_id";
if ($user_info = $site_db->query_firstrow($sql)) {
foreach ($user_table_fields as $key => $val) {
if (isset($user_info[$val])) {
$user_info[$key] = $user_info[$val];
}
elseif (!isset($user_info[$key])) {
$user_info[$key] = "";
}
}
}
}
return $user_info;
}
function get_icq_status($uin) {
// From: http://www.koehntopp.de/php/snippets.html#code-icq
if (!is_numeric($uin)) return FALSE;
$fp = @fsockopen('wwp.icq.com', 80, $errno, $errstr, 8);
if (!$fp) return FALSE;
$request = "HEAD /scripts/online.dll?icq=$uin&img=5 HTTP/1.0\r\n"
."Host: wwp.icq.com\r\n"
."Connection: close\r\n\r\n";
fputs($fp, $request);
do {
$response = fgets($fp, 1024);
}
while (!feof($fp) && !stristr($response, 'Location'));
fclose($fp);
if (strstr($response, '4367')) return 'online';
if (strstr($response, '4349')) return 'offline';
if (strstr($response, '4386')) return 'disabled';
return FALSE;
}
function add_to_lightbox($id) {
global $user_info, $site_db;
$id = intval($id);
if (!$id) {
return false;
}
$lightbox_ids = $user_info['lightbox_image_ids'];
$lightbox_array = explode(" ", $lightbox_ids);
if (!in_array($id, $lightbox_array)) {
$lightbox_ids .= " ".$id;
}
$user_info['lightbox_image_ids'] = trim($lightbox_ids);
$user_info['lightbox_lastaction'] = time();
$sql = "UPDATE ".LIGHTBOXES_TABLE."
SET lightbox_lastaction = ".$user_info['lightbox_lastaction'].", lightbox_image_ids = '".$user_info['lightbox_image_ids']."'
WHERE user_id = ".$user_info['user_id'];
return ($site_db->query($sql)) ? 1 : 0;
}
function remove_from_lightbox($id) {
global $user_info, $site_db;
$lightbox_array = explode(" ",$user_info['lightbox_image_ids']);
foreach ($lightbox_array as $key => $val) {
if ($val == $id) {
unset($lightbox_array[$key]);
}
}
$user_info['lightbox_image_ids'] = trim(implode(" ", $lightbox_array));
$user_info['lightbox_lastaction'] = time();
$sql = "UPDATE ".LIGHTBOXES_TABLE."
SET lightbox_lastaction = ".$user_info['lightbox_lastaction'].", lightbox_image_ids = '".$user_info['lightbox_image_ids']."'
WHERE user_id = ".$user_info['user_id'];
return ($site_db->query($sql)) ? 1 : 0;
}
function clear_lightbox() {
global $user_info, $site_db;
$current_time = time();
$sql = "UPDATE ".LIGHTBOXES_TABLE."
SET lightbox_image_ids = '', lightbox_lastaction = $current_time
WHERE user_id = ".$user_info['user_id'];
if ($site_db->query($sql)) {
$user_info['lightbox_image_ids'] = "";
$user_info['lightbox_lastaction'] = $current_time;
return true;
}
else {
return false;
}
}
function check_lightbox($id) {
global $user_info;
$lightbox_array = explode(" ", $user_info['lightbox_image_ids']);
return in_array($id, $lightbox_array);
}
function get_random_key($db_table = "", $db_column = "") {
global $site_db;
$key = md5(uniqid(microtime()));
if ($db_table != "" && $db_column != "") {
$i = 0;
while ($i == 0) {
$sql = "SELECT ".$db_column."
FROM ".$db_table."
WHERE ".$db_column." = '$key'";
if ($site_db->is_empty($sql)) {
$i = 1;
}
else {
$i = 0;
$key = md5(uniqid(microtime()));
}
}
}
return $key;
}
function get_subcat_ids($cid = 0, $cat_id = 0, $cat_parent_cache) {
global $subcat_ids;
if (!isset($cat_parent_cache[$cid])) {
return false;
}
foreach ($cat_parent_cache[$cid] as $key => $val) {
if (check_permission("auth_viewcat", $val)) {
$subcat_ids[$cat_id][] = $val;
get_subcat_ids($val, $cat_id, $cat_parent_cache);
}
}
return $subcat_ids;
}
function get_subcategories($parent_id) {
global $cat_parent_cache, $cat_cache, $site_sess, $config;
if (!isset($cat_parent_cache[$parent_id]) || $config['num_subcats'] < 1) {
return "";
}
}
}
?>
exif.php
[code]<?php
/*
4images EXIF MOD
Version : 0.3
Date: 2003-01-17
By: fatman (fatman_li@yahoo.com.hk)
*/
// true: enable the field filter
// false: disable the field filter
define('EXIF_CONTROL', true);
// add the field name for show in exif section
// remember the field name with the colon ":"
define('EXIF_FILTER', "
Make:
Model:
DateTime:
Orientation:
ExposureTime:
FNumber:
ShutterSpeedValue:
ISOSpeedRatings:
ExposureBiasValue:
MeteringMode:
Flash:
FocalLength:
ColorSpace:
WhiteBalance:
DigitalZoomRatio:
");
function exif_filter_control() {
return EXIF_CONTROL;
}
function exif_filter($name) {
if (strpos(EXIF_FILTER, ($name . ":")) > 0) {
return true;
} else {
return false;
}
}
function exif_get_str_val($val) {
$val = (substr($val, 0, strpos($val, "/"))) / (substr($val, strpos($val, "/") + 1));
return $val;
}
function exif_parse_value($name, $val) {
switch($name) {
case "Orientation":
if($val==1) $val = "Normal";
if($val==2) $val = "Mirrored";
if($val==3) $val = "Upsidedown";
if($val==4) $val = "Upsidedown Mirrored";
if($val==5) $val = "90deg CW Mirrored";
if($val==6) $val = "90deg CCW";
if($val==7) $val = "90deg CCW Mirrored";
if($val==8) $val = "90deg CW";
break;
case "ResolutionUnit":
if($val==1) $val = "No Unit";
if($val==2) $val = "Inch";
if($val==3) $val = "Centimeter";
break;
case "YCbCrPositioning":
if($val==1) $val = "Pixel Array";
if($val==2) $val = "Datum Point";
break;
case "ExposureTime":
$val = $val . " seconds";
break;
case "FNumber":
$val = "F/" . exif_get_str_val($val);
break;
case "ExposureProgram":
if($val==1) $val = "Manual control";
if($val==2) $val = "Program normal";
if($val==3) $val = "Aperture priority";
if($val==4) $val = "Shutter priority";
if($val==5) $val = "Program creative(slow program)";
if($val==6) $val = "Program action(high-speed program)";
if($val==7) $val = "Portrait mode";
if($val==8) $val = "Landscape mode";
break;
case "ExifVersion":
$val = round($val / 100, 2);
break;
case "ComponentsConfiguration":
$val = bin2hex($val);
$val = str_replace("01","Y",$val);
$val = str_replace("02","Cb",$val);
$val = str_replace("03","Cr",$val);
$val = str_replace("04","R",$val);
$val = str_replace("05","G",$val);
$val = str_replace("06","B",$val);
$val = str_replace("00","",$val);
break;
case "CompressedBitsPerPixel":
$val = exif_get_str_val($val);
break;
case "ShutterSpeedValue":
$val = "1/" . round(pow(2, exif_get_str_val($val))) . " seconds";
break;
case "ApertureValue":
$val = "F/" . round(pow(sqrt(2), exif_get_str_val($val)),1);
break;
case "BrightnessValue ":
$val = exif_get_str_val($val);
break;
case "ExposureBiasValue":
if ((substr($val, 0, strpos($val, "/"))) == "0") {
$val = "0 Step";
} else {
$val = $val . " Step";
}
break;
case "MaxApertureValue":
$val = "F/" . round(pow(sqrt(2), exif_get_str_val($val)),1);
break;
case "SubjectDistance":
$val = exif_get_str_val($val) . " M";
break;
case "MeteringMode":
if($val==0) $val = "Unknown";
if($val==1) $val = "Average";
if($val==2) $val = "Center Weighted Average";
if($val==3) $val = "Spot";
if($val==4) $val = "Multi-spot";
if($val==5) $val = "Multi-segment";
if($val==6) $val = "Partial";
if($val==255) $val = "Other";
break;
case "LightSource":
if($val==0) $val = "Unknown";
if($val==1) $val = "Daylight";
if($val==2) $val = "Fluorescent";
if($val==3) $val = "Tungsten";
if($val==10) $val = "Flash";
if($val==17) $val = "Standard light A";
if($val==18) $val = "Standard light B";
if($val==19) $val = "Standard light C";
if($val==20) $val = "D55";
if($val==21) $val = "D65";
if($val==22) $val = "D75";
if($val==255) $val = "Other";
break;
case "Flash":
if($val==0) $val = "No Flash";
if($val==1) $val = "Flash fired";
if($val==5) $val = "Flash fired but strobe return light not detected";
if($val==7) $val = "Flash fired and strobe return light detected";
if($val==9) $val = "Undefined";
break;
case "FocalLength":
$val = exif_get_str_val($val) . " mm";
break;
case "FlashPixVersion":
$val = round($val / 100, 2);
break;
case "ColorSpace":
if($val==1) $val = "sRGB";
if($val=='65535') $val = "Uncalibrated";
break;
case "FocalPlaneXResolution":
$val = round(exif_get_str_val($val));
break;
case "FocalPlaneYResolution":
$val = round(exif_get_str_val($val));
break;
case "FocalPlaneResolutionUnit":
if($val==1) $val = "No Unit";
if($val==2) $val = "Inch";
if($val==3) $val = "Centimeter";
break;
case "SensingMethod":
if($val==2) $val = "1 chip color area sensor";
break;
case "FileSource":
$val = bin2hex($val);
if($val==0x03) $val = "Digital still camera";
break;
case "FileSource":
$val = bin2hex($val);
&nbs
-
}
}
?>
in der functions.php ist die letzte } zuviel
-
exif.php
weiter
break;
case "FileSource":
$val = bin2hex($val);
if($val==0x01) $val = "Directly photographed";
break;
}
return $val;
}
?>
exif_bit.html
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=windows-1252">
<title></title>
</head>
<body>
<tr>
<td valign="top" class="row{row_bg_number}"><b>{exif_name}</b></td>
<td valign="top" class="row{row_bg_number}">{exif_value}</td>
</tr>
</body>
</html>
Und
details.htlm
{header}
<table width="100%" border="0" cellspacing="0" cellpadding="0" align="center">
<tr>
<td>
<table cellpadding="0" cellspacing="0" width="100%" border="0" bgcolor="#000000">
<tr>
<td width="100%">
<table border="0" cellpadding="0" cellspacing="0" bgcolor="#000000" width="100%" height="62" background="{template_url}/images/bbcell.gif">
<tr>
<td width="50%" align="left">
<img src="{template_url}/images/header_logo.gif" align="center" alt="" /></td>
<td width="50%" align="right" >
<form method="post" action="{url_search}">
<table border="0" cellspacing="0" cellpadding="1">
<tr>
<td>
<input type="text" name="search_keywords" size="15" class="searchinput" />
</td>
<td>
<input type="submit" value="{lang_search}" class="button" name="submit" />
</td>
</tr>
<tr valign="top">
<td colspan="2"><a href="{url_search}" class="smalltext">{lang_advanced_search}</a></td>
</tr>
</table>
</form>
</td>
</tr>
</table>
</td>
</tr>
</table>
</td>
</tr>
<tr>
<td class="bordercolor">
<table width="100%" border="0" cellspacing="1" cellpadding="0">
<tr>
<td class="tablebgcolor">
<table width="100%" border="0" cellspacing="0" cellpadding="0">
<tr>
<td class="navbar" height="23">
<table width="100%" border="0" cellspacing="0" cellpadding="0">
<tr>
<td align="left" width="50%">
<img src="{template_url}/images/spacer.gif" width="4" height="4" alt="" />{clickstream}
</td>
<td align="right" width="50%">
<a href="{url_top_images}"><b>{lang_top_images}</b></a>
<a href="{url_new_images}"><b>{lang_new_images}</b></a>
</td>
</tr>
</table>
</td>
</tr>
</table>
<table width="100%" border="0" cellspacing="0" cellpadding="0">
<tr>
<td width="150" class="row2" valign="top">
<table width="150" border="0" cellspacing="0" cellpadding="0">
<tr>
<td class="head2" height="20"><img src="{template_url}/images/spacer.gif" alt="" width="4" height="4" />{lang_registered_user}</td>
</tr>
<tr>
<td class="tablebgcolor"><img src="{template_url}/images/spacer.gif" alt="" width="1" height="1" /></td>
</tr>
<tr>
<td align="center" class="row1">{user_box} </td>
</tr>
<tr>
<td class="tablebgcolor"><img src="{template_url}/images/spacer.gif" alt="" width="1" height="1" /></td>
</tr>
</table>
{if random_cat_image}
<table width="150" border="0" cellspacing="0" cellpadding="0">
<tr>
<td class="head2" height="20"> <img src="{template_url}/images/spacer.gif" alt="" width="4" height="4" />{lang_random_image}</td>
</tr>
<tr>
<td class="tablebgcolor"><img src="{template_url}/images/spacer.gif" alt="" width="1" height="1" /></td>
</tr>
<tr>
<td align="center" class="row1">
<br />
{random_cat_image}
<br />
<br />
</td>
</tr>
<tr>
<td class="tablebgcolor"><img src="{template_url}/images/spacer.gif" alt="" width="1" height="1" /></td>
</tr>
</table>
{endif random_cat_image}
<p align="center">
<?php
echo date("d.m.Y, H:i");
?>
</p>
<?php include("4darkm.php"); ?>
<br />
</td>
<td width="1" class="bordercolor" valign="top"><img src="{template_url}/images/spacer.gif" width="1" height="1" alt="" /></td>
<td width="18" valign="top"><img src="{template_url}/images/spacer.gif" width="18" height="18" alt="" /></td>
<td width="100%" valign="top"><br />
<table width="100%" border="0" cellspacing="0" cellpadding="1">
<tr>
<td class="bordercolor">
<table width="100%" border="0" cellspacing="0" cellpadding="3">
<tr valign="top">
<td class="row2">
{if prev_image_name}{lang_prev_image}<br />
<b><a href="{prev_image_url}">{prev_image_name}</a></b>
<!-- <br /><br /><a href="{prev_image_url}"><img src="{prev_thumb_file}" border="1"></a> -->
{endif prev_image_name} </td>
<td align="right" class="row2">
{if next_image_name}{lang_next_image}<br />
<b><a href="{next_image_url}">{next_image_name}</a></b>
<!-- <br /><br /><a href="{next_image_url}"><img src="{next_thumb_file}" border="1"></a> -->
{endif next_image_name}</td>
</tr>
</table>
</td>
</tr>
</table>
<br>
<b class="title">{image_name}</b>{if image_is_new} <sup class="new">{lang_new}</sup>{endif image_is_new}
<hr size="1" />
{if msg}<b>{msg}<br /><br /></b>{endif msg}
<div align="center">
{image}
{if admin_links}<br />{admin_links}<br />{endif admin_links}
<br />{lightbox_button} {postcard_button} {download_button} {download_zip_button}
</div><br />
<table width="100%" border="0" cellspacing="0" cellpadding="1">
<tr>
<td class="bordercolor">
<table width="100%" border="0" cellpadding="3" cellspacing="0">
<tr>
<td class="head1" valign="top" colspan="2">{image_name}</td>
</tr>
<tr>
<td valign="top" class="row1"><b>{lang_description}</b></td>
<td valign="top" class="row1">{image_description}</td>
</tr>
<tr>
<td valign="top" class="row2"><b>{lang_keywords}</b></td>
<td valign="top" class="row2">{image_keywords}</td>
</tr>
<tr>
<td valign="top" class="row1"><b>{lang_date}</b></td>
<td valign="top" class="row1">{image_date}</td>
</tr>
<tr>
<td valign="top" class="row2"><b>{lang_hits}</b></td>
<td valign="top" class="row2">{image_hits}</td>
</tr>
<tr>
<td valign="top" class="row1"><b>{lang_downloads}</b></td>
<td valign="top" class="row1">{image_downloads}</td>
</tr>
<tr>
<td valign="top" class="row2"><b>{lang_rating}</b></td>
<td valign="top" class="row2">{image_rating} ({image_votes}
{lang_votes})</td>
</tr>
<tr>
<td valign="top" class="row1"><b>{lang_file_size}</b></td>
<td valign="top" class="row1">{image_file_size}</td>
</tr>
<tr>
<td valign="top" class="row2"><b>{lang_added_by}</b></td>
<td valign="top" class="row2">{user_name_link}</td>
</tr>
<tr>
<td valign="top" class="row1"><b>{lang_image_test}</b></td>
<td valign="top" class="row1">{image_test}</td>
</tr>
<tr>
<td valign="top" class="row2"><b>{lang_image_test2}</b></td>
<td valign="top" class="row2">{image_test2}</td>
</tr>
</table>
</td>
</tr>
</table>
{if iptc_info}<br />
<table width="100%" border="0" cellspacing="0" cellpadding="1">
<tr>
<td class="bordercolor">
<table width="100%" border="0" cellpadding="3" cellspacing="0">
<tr>
<td class="head1" valign="top">IPTC Info</td>
</tr>
{iptc_info}
</table>
</td>
</tr>
</table>
{endif iptc_info}
{if exif_info}
<br />
<table width="100%" border="0" cellspacing="0" cellpadding="1">
<tr>
<td class="bordercolor">
<table width="100%" border="0" cellpadding="3" cellspacing="0">
<tr>
<td class="head1" valign="top" colspan="2">EXIF Info</td>
</tr>
{exif_info}
</table>
</td>
</tr>
</table>
{endif exif_info}
{if rate_form}<div align="center">{rate_form}</div>{endif rate_form}
{if allow_comments}
<br />
<table width="100%" border="0" cellspacing="0" cellpadding="0" align="center">
<tr>
<td class="head1" valign="top">
<table width="100%" border="0" cellpadding="3" cellspacing="1">
<tr>
<td valign="top" class="head1">
{lang_author}
</td>
<td valign="top" class="head1">
{lang_comment}
</td>
</tr>
{comments}
</table>
</td>
</tr>
</table>
<br />
{comment_form}
{endif allow_comments}
<br /><br />
<table width="100%" border="0" cellspacing="0" cellpadding="1">
<tr>
<td class="bordercolor">
<table width="100%" border="0" cellspacing="0" cellpadding="3">
<tr valign="top">
<td class="row2">
{if prev_image_name}{lang_prev_image}<br />
<b><a href="{prev_image_url}">{prev_image_name}</a></b>
<!-- <br /><br /><a href="{prev_image_url}"><img src="{prev_thumb_file}" border="1"></a> -->
{endif prev_image_name} </td>
<td align="right" class="row2">
{if next_image_name}{lang_next_image}<br />
<b><a href="{next_image_url}">{next_image_name}</a></b>
<!-- <br /><br /><a href="{next_image_url}"><img src="{next_thumb_file}" border="1"></a> -->
{endif next_image_name}</td>
</tr>
</table>
</td>
</tr>
</table>
<p> </p>
</td>
<td width="19" valign="top"><img src="{template_url}/images/spacer.gif" alt="" width="19" height="19" /></td>
</tr>
</table>
</td>
</tr>
</table>
</td>
</tr>
<tr>
<td>
</td>
</tr>
</table>
{footer}
-
na das war doch schon nicht mehr nötig...
-
Doch den jetzt bekomme ich diese Fehlmeldung:
Fatal error: Call to undefined function: get_category_dropdown() in /mnt/ja2/07/460/00000013/htdocs/Album/includes/page_header.php on line 157
-
du musst die änderungen die Du an der functions.php vorgenommen hast nochmal überprüfen, den ohne Grund ist die Klammer ja nicht übrig gewesen...
Der Fehler liegt sicherlich in der Datei, weil die page_header.php versucht eine Funktion in der functions.php aufzurufen welche fehlerhaft ist oder ganz fehlt.... (o:
-
Oh man ich hch habe nur Kopiert und Kopiert :(
Aber was ich genau geändert habe weiß ich auch nicht mehr.
Nun ich glaube ich gebe zwangsläufig auf :cry:
Und ich fand die Funktion so gut....
Die frage ist jetzt bloß wie bekomme ich den alten Stand wieder her???
Muss ich doch weiter machen...
Hat jemand die Function.php für mich :oops:
Gruß Volker
PHP ist ein Brief mit sieben Siegeln für mich.
-
also als erstest immer ein Backup von den Dateien machen.
Dann schnappst Du dir einfach die 4images zip datei und schiebst die functions.php aus dem zip auf den Server, aber nur wenn Du bisher nur diese Änderungen vorgenommen hast.
Aber ich würde echt versuchen es nochmal zu machen, ich denke du hast nur einen kleinen Fehler drin gehabt... (o:
-
Verzweifel......................................................... :evil:
-
HAste das wiederherstellen nicht hinbekommen?
-
Das ging genauso jetzt in die Hose (habe zwischen durch mehr geändert gehabt) bin jetzt wieder auf den Stand von erst.....Dank BackUp :x
siehe www.schulzhome.de/Album/
Mis. Mis.
Und ich habe nur mal kurz..... :?
-
so jetzt bleibe ganz ruhig und versuche uns mal zu erklären was Du bisher angestellt hast.
Welche Mods haste bisher eingebaut und seit wann läuft es nicht mehr? Liegt es wirklich an diesem Mod und hast Du wie von mir vorgeschlagen noch mal alle Schritte nacheinmal durchgeschaut?
-
Also bis ich heute Anfing lief die Page 100 Pro.
Dann habe ich angefangen und die Schritte von fatman auf Seite 1 durchgezogen.
Funtionierte nicht!
Dann war ich ganz Schlau :evil:und habe auf Seite 4 oder war es 5 von anabell kopiert und genommen.
Dabei ist dann dieser jetzige Fehler aufgetreten.
Das Ändern auf die Alte Version klappte nicht da ich ein Version von BaliWeb oder so hatte!
Und nun bin ich dabei es doch noch weiter zu Versuchen das von Heute Morgen zu Retten!
Bloß wie?
und meine Frau steht mir im Nacken und Nervt das ich jetzt erstmal Esssen soll (Nerv) bin in 30 Minuten wieder da dann habe ich mehr Ruhe...
Gruß Volker
-
also am einfachsten wäre es du nimmst die orginal functios.php und baust alles neu ein.
Und wenn du eine geänderte functions.php von BaliWeb geenutzt hast nimm die und versuche damit einen neuen anlauf...
-
@reklov
bevor du sie modifiziert hast - hast du sie sicher kopiert - oder etwa nicht?
gruss
vincent
-
So jetzt bekom ich den Brrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrr...
Habe alles von Server geschmiessen und Neu aufgespielt! 8wie gut das ich auf meiner Externen noch ein BackUp hatte)
Doch nun?...............
Stellt er nicht mehr Automatische Vorschaubilder!
Und gibt mir diesen Fehlercode noch dem Uplaod:
Warning: imagejpeg(): Unable to access ./data/thumbnails/6/PICT2716.JPG in /mnt/ja2/07/460/00000013/htdocs/Album/includes/image_utils.php on line 89
Warning: imagejpeg(): Invalid filename './data/thumbnails/6/PICT2716.JPG' in /mnt/ja2/07/460/00000013/htdocs/Album/includes/image_utils.php on line 89
Ich könnte K....
@Vincent: Ja vor einer Woche Teu teu Teu!
So wo mache ich jetzt weiter?
-
Gehe ich in den Control Panell und Versuche eine Miniatur Thumb zu erstellen kommt zum Schluß:
Erstelle Thumbnail für: Test3 (PICT2716.JPG) ....
Warning: imagejpeg(): Unable to access ./../data/thumbnails/6/PICT2716.JPG in /mnt/ja2/07/460/00000013/htdocs/Album/includes/image_utils.php on line 89
Warning: imagejpeg(): Invalid filename './../data/thumbnails/6/PICT2716.JPG' in /mnt/ja2/07/460/00000013/htdocs/Album/includes/image_utils.php on line 89
Fehler beim Erstellen des Thumbnails!
Was habe ich bloß Verkehrt gemacht?
(Ich glaube mit Wettten Dass wird das heute nichts :?)
-
So ein netter User hat mir seine functions.php und exif.php geschickt!
Habe Sie mal Aufgespielt!
Ergebniss?
Nun ich sehe das Album!
Uplaod klappt auch, gehe ich dann aber auf Home sehe ich erstens wieder das kleine Auge statt eine Vorschau.
Klicke ich auf das Auge kommt:
Fatal error: Call to undefined function: exif_read_data() in /mnt/ja2/07/460/00000013/htdocs/Album/includes/functions.php on line 399
Es ist ja nicht so das ich es gerne Einfach habe aber was solls vielleicht lerne ich ja noch mehr...
-
Also das die Thumbnails nicht erstellt werden liegt bestimmt an den Rechten (777???).
Für den Rest musste nochmal den Code von deiner functions.php posten... (o:
-
An den Rechten??????????????? Hey ich bin der Fotograph! :P
Code OK hier:
[code]<?php
/**************************************************************************
* *
* 4images - A Web Based Image Gallery Management System *
* ---------------------------------------------------------------- *
* *
* File: functions.php *
* Copyright: (C) 2002 Jan Sorgalla *
* Email: jan@4homepages.de *
* Web: http://www.4homepages.de *
* Scriptversion: 1.7.1 *
* *
* Never released without support from: Nicky (http://www.nicky.net) *
* *
**************************************************************************
* *
* Dieses Script ist KEINE Freeware. Bitte lesen Sie die Lizenz- *
* bedingungen (Lizenz.txt) für weitere Informationen. *
* --------------------------------------------------------------- *
* This script is NOT freeware! Please read the Copyright Notice *
* (Licence.txt) for further information. *
* *
*************************************************************************/
if (!defined('ROOT_PATH')) {
die("Security violation");
}
include(ROOT_PATH.'includes/exif.php');
function get_gallery_image($image_name) {
global $config;
if (file_exists(TEMPLATE_PATH."/images_".$config['language_dir']."/".$image_name)) {
return TEMPLATE_PATH."/images_".$config['language_dir']."/".$image_name;
}
else {
return TEMPLATE_PATH."/images/".$image_name;
}
}
function is_remote($file_name) {
return strpos($file_name, '://') > 0 ? 1 : 0;
}
function is_remote_file($file_name) {
return is_remote($file_name) && preg_match("#\.[a-zA-Z0-9]{1,4}$#", $file_name) ? 1 : 0;
}
function is_local_file($file_name) {
return !is_remote($file_name) && strpos($file_name, '/') !== false && preg_match("#\.[a-zA-Z0-9]{1,4}$#", $file_name) ? 1 : 0;
}
function check_remote_media($remote_media_file) {
global $config;
return is_remote($remote_media_file) && preg_match("#\.[".$config['allowed_mediatypes_match']."]+$#i", $remote_media_file) ? 1 : 0;
}
function check_local_media($local_media_file) {
global $config;
return !is_remote($local_media_file) && strpos($local_media_file, '/') !== false && preg_match("#\.[".$config['allowed_mediatypes_match']."]+$#i", $local_media_file) ? 1 : 0;
}
function check_remote_thumb($remote_thumb_file) {
return is_remote($remote_thumb_file) && preg_match("#\.[gif|jpg|jpeg|png]+$#is", $remote_thumb_file) ? 1 : 0;
}
function check_local_thumb($remote_thumb_file) {
return !is_remote($local_thumb_file) && strpos($local_thumb_file, '/') !== false && preg_match("#\.[gif|jpg|jpeg|png]+$#i", $local_thumb_file) ? 1 : 0;
}
function get_file_extension($file_name) {
ereg("(.+)\.(.+)", basename($file_name), $regs);
return strtolower($regs[2]);
}
function get_file_name($file_name) {
ereg("(.+)\.(.+)", basename($file_name), $regs);
return $regs[1];
}
function check_media_type($file_name) {
global $config;
return (in_array(get_file_extension($file_name), $config['allowed_mediatypes_array'])) ? 1 : 0;
}
function check_thumb_type($file_name) {
return (preg_match("#(gif|jpg|jpeg|png)$#is", $file_name)) ? 1 : 0;
}
function check_executable($file_name) {
if (substr(PHP_OS, 0, 3) == "WIN" && !eregi("\.exe$", $file_name)) {
$file_name .= ".exe";
}
elseif (substr(PHP_OS, 0, 3) != "WIN") {
$file_name = eregi_replace("\.exe$", "", $file_name);
}
return $file_name;
}
function get_file_path($file_name = "", $image_type = "media", $cat_id = 0, $in_admin = 0, $return_icon = 1, $check_remote = CHECK_REMOTE_FILES) {
$return_code = ($return_icon) ? ICON_PATH."/404.gif" : 0;
if (empty($file_name)) {
return $return_code;
}
if (is_remote($file_name)) {
$check_handle = "check_remote_".$image_type;
return ($check_handle($file_name) && remote_file_exists($file_name, $check_remote)) ? (($in_admin && !preg_match("#(gif|jpg|jpeg|png)$#is", $file_name)) ? ICON_PATH."/".get_file_extension($file_name).".gif" : $file_name) : $return_code;
}
elseif (is_local_file($file_name)) {
$check_handle = "check_local_".$image_type;
$file_name = ($in_admin && preg_match("/^([\.]+|[^\/])/", $file_name)) ? "../".$file_name : $file_name;
if (!file_exists($file_name)) {
$file_path = preg_replace("/\/{2,}/", "/", get_document_root()."/".$file_name);
return ($check_handle($file_name) && file_exists($file_path)) ? (($in_admin && !preg_match("#(gif|jpg|jpeg|png)$#is", $file_name)) ? ICON_PATH."/".get_file_extension($file_name).".gif" : $file_name) : $return_code;
}
else {
return $file_name;
}
}
else {
$check_handle = "check_".$image_type."_type";
$path = (($image_type == "media") ? (($cat_id) ? MEDIA_PATH."/".$cat_id : MEDIA_TEMP_PATH) : (($cat_id) ? THUMB_PATH."/".$cat_id : THUMB_TEMP_PATH))."/".$file_name;
return ($check_handle($file_name) && file_exists($path)) ? (($in_admin && !preg_match("#(gif|jpg|jpeg|png)$#is", $file_name)) ? ICON_PATH."/".get_file_extension($file_name).".gif" : $path) : $return_code;
}
}
function safe_htmlspecialchars($chars) {
// Translate all non-unicode entities
$chars = preg_replace('/&(?!#[0-9]+;)/si', '&', $chars);
$chars = str_replace(">", ">", $chars);
$chars = str_replace("<", "<", $chars);
$chars = str_replace("\"", """, $chars);
return $chars;
}
function un_htmlspecialchars($chars) {
//$chars = preg_replace("/(&#)([0-9]*)(;)/esiU", "chr(intval('\\2'))", $chars);
$chars = str_replace(">", ">", $chars);
$chars = str_replace("<", "<", $chars);
$chars = str_replace(""", "\"", $chars);
$chars = str_replace("&", "&", $chars);
return $chars;
}
function get_iptc_info($info) {
$iptc_match = array();
$iptc_match['2#120'] = "caption";
$iptc_match['2#122'] = "caption_writer";
$iptc_match['2#105'] = "headline";
$iptc_match['2#040'] = "special_instructions";
$iptc_match['2#080'] = "byline";
$iptc_match['2#085'] = "byline_title";
$iptc_match['2#110'] = "credit";
$iptc_match['2#115'] = "source";
$iptc_match['2#005'] = "object_name";
$iptc_match['2#055'] = "date_created";
$iptc_match['2#090'] = "city";
$iptc_match['2#095'] = "state";
$iptc_match['2#101'] = "country";
$iptc_match['2#103'] = "original_transmission_reference";
$iptc_match['2#015'] = "category";
$iptc_match['2#020'] = "supplemental_category";
$iptc_match['2#025'] = "keyword";
$iptc_match['2#116'] = "copyright_notice";
$iptc = iptcparse($info);
$iptc_array = array();
if (is_array($iptc)) {
foreach ($iptc as $key => $val) {
if (isset($iptc_match[$key])) {
$iptc_info = "";
foreach ($val as $val2) {
$iptc_info .= (($iptc_info != "" ) ? ", " : "").$val2;
}
if ($key == "2#055") {
$iptc_array[$iptc_match[$key]] = preg_replace("/([0-9]{4})([0-9]{2})([0-9]{2})/", "\\3.\\2.\\1", $iptc_info);
}
else {
$iptc_array[$iptc_match[$key]] = replace_url($iptc_info);
}
}
}
}
return $iptc_array;
}
function show_image($image_row, $mode = "", $show_link = 1, $detailed_view = 0) {
global $self_url, $site_template, $site_sess, $user_info, $config, $cat_cache, $lang, $additional_image_fields, $user_table_fields, $url_show_profile;
$is_new = ($image_row['image_date'] >= (time() - 60 * 60 * 24 * $config['new_cutoff'])) ? 1 : 0;
$description = (!empty($image_row['image_description'])) ? format_text($image_row['image_description'], 1) : REPLACE_EMPTY;
if (!empty($image_row['image_keywords'])) {
$split_keywords = explode(" ", $image_row['image_keywords']);
$keywords = "";
foreach ($split_keywords as $key => $val) {
$keywords .= (($keywords != "" ) ? ", " : "")."<a href=\"".$site_sess->url(ROOT_PATH."search.php?search_keywords=".urlencode($val))."\">$val</a>";
}
}
else {
$keywords = REPLACE_EMPTY;
}
if (!check_permission("auth_readcomment", $image_row['cat_id'])) {
$image_row['image_allow_comments'] = 0;
}
$num_comments = ($image_row['image_allow_comments'] == 1) ? $image_row['image_comments'] : "";
if ($user_info['user_level'] != GUEST) {
$lightbox_url = $self_url;
$lightbox_url .= (!empty($mode)) ? ((strpos($lightbox_url, '?') !== false) ? "&" : "?")."mode=".$mode : "";
$lightbox_url .= strpos($lightbox_url, '?') !== false ? "&" : "?";
if (check_lightbox($image_row['image_id'])) {
$lightbox_url .= "action=removefromlightbox&id=".$image_row['image_id'];
$lightbox_button = "<a href=\"".$site_sess->url($lightbox_url)."\"><img src=\"".get_gallery_image("lightbox_yes.gif")."\" border=\"0\" alt=\"\" /></a>";
}
else {
$lightbox_url .= "action=addtolightbox&id=".$image_row['image_id'];
$lightbox_button = "<a href=\"".$site_sess->url($lightbox_url)."\"><img src=\"".get_gallery_image("lightbox_no.gif")."\" border=\"0\" alt=\"\" /></a>";
}
}
else {
$lightbox_button = "<img src=\"".get_gallery_image("lightbox_off.gif")."\" border=\"0\" alt=\"\" />";
}
if (!check_permission("auth_download", $image_row['cat_id'])) {
$download_button = "<img src=\"".get_gallery_image("download_off.gif")."\" border=\"0\" alt=\"\" />";
$download_zip_button = (function_exists("gzcompress") && function_exists("crc32")) ? "<img src=\"".get_gallery_image("download_zip_off.gif")."\" border=\"0\" alt=\"\" />" : "";
$allow_download = 0;
}
else {
$target = (!empty($image_row['image_download_url']) && !is_remote_file($image_row['image_download_url']) && !is_local_file($image_row['image_download_url'])) ? "target=\"_blank\"" : "";
$download_button = "<a href=\"".$site_sess->url(ROOT_PATH."download.php?".URL_IMAGE_ID."=".$image_row['image_id'])."\"".$target."><img src=\"".get_gallery_image("download.gif")."\" border=\"0\" alt=\"\" /></a>";
$download_zip_button = ($target == "" && function_exists("gzcompress") && function_exists("crc32")) ? "<a href=\"".$site_sess->url(ROOT_PATH."download.php?action=zip&".URL_IMAGE_ID."=".$image_row['image_id'])."\"".$target."><img src=\"".get_gallery_image("download_zip.gif")."\" border=\"0\" alt=\"\" /></a>" : "";
$allow_download = 1;
}
if (!check_permission("auth_sendpostcard", $image_row['cat_id'])) {
$postcard_button = "<img src=\"".get_gallery_image("postcard_off.gif")."\" border=\"0\" alt=\"\" />";
}
else {
$postcard_button = "<a href=\"".$site_sess->url(ROOT_PATH."postcards.php?".URL_IMAGE_ID."=".$image_row['image_id'].((!empty($mode)) ? "&mode=".$mode : ""))."\"><img src=\"".get_gallery_image("postcard.gif")."\" border=\"0\" alt=\"\" /></a>";
}
if (!check_permission("auth_viewimage", $image_row['cat_id']) || !check_permission("auth_viewcat", $image_row['cat_id'])) {
$show_link = 0;
}
$file_size = "n/a";
if (!is_remote($image_row['image_media_file'])) {
if ($file_size = @filesize(MEDIA_PATH."/".$image_row['cat_id']."/".$image_row['image_media_file'])) {
$file_size = format_file_size($file_size);
}
}
elseif ($detailed_view) {
$file_size = get_remote_file_size($image_row['image_media_file']);
}
if (isset($image_row[$user_table_fields['user_name']]) && $image_row['user_id'] != GUEST) {
$user_name = $image_row[$user_table_fields['user_name']];
$user_profile_link = (!empty($url_show_profile)) ? preg_replace("/{user_id}/", $image_row['user_id'], $url_show_profile) : ROOT_PATH."member.php?action=showprofile&".URL_USER_ID."=".$image_row['user_id'];
$user_name_link = "<a href=\"".$site_sess->url($user_profile_link)."\">".$user_name."</a>";
}
else {
$user_name = $lang['userlevel_guest'];
$user_name_link = $user_name;
}
$site_template->register_vars(array(
"image_id" => $image_row['image_id'],
"user_id" => $image_row['user_id'],
"user_name" => $user_name,
"user_name_link" => $user_name_link,
"image_name" => $image_row['image_name'],
"image_description" => $description,
"image_keywords" => $keywords,
"image_date" => format_date($config['date_format']." ".$config['time_format'],$image_row['image_date']),
"image_is_new" => $is_new,
"lang_new" => $lang['new'],
"image_active" => $image_row['image_active'],
"cat_id" => $image_row['cat_id'],
"cat_name" => $image_row['cat_name'],
"cat_url" => $site_sess->url(ROOT_PATH."categories.php?".URL_CAT_ID."=".$image_row['cat_id']),
"image_downloads" => $image_row['image_downloads'],
"image_votes" => $image_row['image_votes'],
"image_rating" => $image_row['image_rating'],
"image_hits" => $image_row['image_hits'],
"allow_comments" => $image_row['image_allow_comments'],
"lang_comments" => $lang['comments'],
"image_comments" => $num_comments,
"lightbox_button" => $lightbox_button,
"postcard_button" => $postcard_button,
"download_button" => $download_button,
"download_zip_button" => $download_zip_button,
"image_download_url" => $image_row['image_download_url'],
"allow_download" => $allow_download,
"url_download" => $site_sess->url(ROOT_PATH."download.php?".URL_IMAGE_ID."=".$image_row['image_id']),
"image_file_size" => $file_size,
"image" => get_media_code($image_row['image_media_file'], $image_row['image_id'], $image_row['cat_id'], $image_row['image_name'], $mode, $show_link, $detailed_view),
"thumbnail" => get_thumbnail_code($image_row['image_media_file'], $image_row['image_thumb_file'], $image_row['image_id'], $image_row['cat_id'], $image_row['image_name'], $mode, $show_link),
"thumbnail_openwindow" => get_thumbnail_code($image_row['image_media_file'], $image_row['image_thumb_file'], $image_row['image_id'], $image_row['cat_id'], $image_row['image_name'], $mode, $show_link, 1),
"image_file_name" => $image_row['image_media_file'],
"thumbnail_file_name" => $image_row['image_thumb_file']
));
if (!empty($additional_image_fields)) {
$additional_field_array = array();
foreach ($additional_image_fields as $key => $val) {
$additional_field_array[$key] = (!empty($image_row[$key])) ? format_text($image_row[$key], 1) : REPLACE_EMPTY;
$additional_field_array['lang_'.$key] = $val[0];
}
if (!empty($additional_field_array)) {
$site_template->register_vars($additional_field_array);
}
}
$rate_form = "";
if (check_permission("auth_vote", $image_row['cat_id'])) {
$site_template->register_vars("rate", $lang['rate']);
$rate_form = $site_template->parse_template("rate_form");
}
$site_template->register_vars("", $rate_form);
return true;
}
function get_thumbnail_code($media_file_name, $thumb_file_name = "", $image_id, $cat_id, $image_name = "", $mode = "", $show_link = 1, $open_window = 0) {
global $site_sess, $config;
if (!check_media_type($media_file_name)) {
$thumb = "<img src=\"".ICON_PATH."/404.gif\" border=\"0\" alt=\"\" />";
}
else {
if (!get_file_path($thumb_file_name, "thumb", $cat_id, 0, 0)) {
$file_src = ICON_PATH."/".get_file_extension($media_file_name).".gif";
$image_info = @getimagesize($file_src);
$width_height = (!empty($image_info[3])) ? " ".$image_info[3] : "";
$thumb = "<img src=\"".$file_src."\" border=\"0\"".$width_height." alt=\"".$image_name."\" />";
}
else {
$file_src = get_file_path($thumb_file_name, "thumb", $cat_id, 0, 1);
$image_info = @getimagesize($file_src);
$width_height = (!empty($image_info[3])) ? " ".$image_info[3] : "";
$thumb = "<img src=\"".$file_src."\" border=\"".$config['image_border']."\"".$width_height." alt=\"".$image_name."\" />";
}
}
if ($show_link) {
if ($open_window) {
$thumb = "<a href=\"".$site_sess->url(ROOT_PATH."details.php?".URL_IMAGE_ID."=".$image_id.((!empty($mode)) ? "&mode=".$mode : ""))."\" onclick=\"opendetailwindow()\" target=\"detailwindow\">".$thumb."</a>";
}
else {
$thumb = "<a href=\"".$site_sess->url(ROOT_PATH."details.php?".URL_IMAGE_ID."=".$image_id.((!empty($mode)) ? "&mode=".$mode : ""))."\">".$thumb."</a>";
}
}
return $thumb;
}
function get_media_code($media_file_name, $image_id = 0, $cat_id = 0, $image_name = "", $mode = "", $show_link = 0, $detailed_view = 0) {
global $site_template, $site_sess, $lang, $mode;
if (!get_file_path($media_file_name, "media", $cat_id, 0, 0)) {
$media = "<img src=\"".ICON_PATH."/404.gif\" border=\"0\" alt=\"\" />";
$site_template->register_vars("iptc_info", "");
}
else {
$media_src = get_file_path($media_file_name, "media", $cat_id, 0, 1);
$file_extension = get_file_extension($media_file_name);
$media_icon = "<img src=\"".ICON_PATH."/".$file_extension.".gif\" border=\"0\" alt=\"".$image_name."\" />";
if ($show_link) {
$media_icon = "<a href=\"".$site_sess->url(ROOT_PATH."details.php?".URL_IMAGE_ID."=".$image_id.((!empty($mode)) ? "&mode=".$mode : ""))."\">".$media_icon."</a>";
}
$width_height = "";
$width = "";
$height = "";
$iptc_info = "";
$src = (!file_exists($media_src) && file_exists(preg_replace("/\/{2,}/", "/", get_document_root()."/".$media_src))) ? preg_replace("/\/{2,}/", "/", get_document_root()."/".$media_src) : $media_src;
if ($image_info = @getimagesize($src, $info)) {
$width_height = " ".$image_info[3];
$width = $image_info[0];
$height = $image_info[1];
if ($detailed_view && isset($info['APP13'])) {
$iptc_array = get_iptc_info($info['APP13']);
$bgcounter = 0;
foreach ($iptc_array as $key => $val) {
$row_bg_number = ($bgcounter++ % 2 == 0) ? 1 : 2;
$site_template->register_vars(array(
"iptc_value" => $val,
"iptc_name" => $lang['iptc_'.$key],
"row_bg_number" => $row_bg_number
));
$iptc_info .= $site_template->parse_template("iptc_bit");
}
}
$exif_info = "";
if ((($file_extension == "jpg") || ($file_extension == "jpeg")) &&($detailed_view)) {
$exif = exif_read_data ($media_src,'IFD0');
$bgcounter = 0;
if ($exif) {
$exif = exif_read_data ($media_src,0,true);
foreach($exif as $key=>$section) {
if (($key == "IFD0") || ($key == "EXIF")) {
foreach($section as $name=>$val) {
if (!(exif_filter($name)) && exif_filter_control()) continue;
$row_bg_number = ($bgcounter++ % 2 == 0) ? 1 : 2;
$site_template->register_vars(array(
"exif_value" => exif_parse_value($name, $val),
"exif_name" => exif_parse_name($name, $val),
"row_bg_number" => $row_bg_number
));
$exif_info .= $site_template->parse_template("exif_bit");
}
}
}
}
}
}
$site_template->register_vars(array(
"media_src" => $media_src,
"media_icon" => $media_icon,
"image_name" => $image_name,
"width_height" => $width_height,
"width" => $width,
"height" => $height,
"" => $iptc_info,
"exif_info" => $exif_info
));
$media = $site_template->parse_template("media/".$file_extension);
}
return $media;
}
function get_random_image_cache() {
global $site_db, $cat_cache, $total_images;
$random_image_cache = array();
$cat_id_sql = get_auth_cat_sql("auth_viewcat", "NOTIN");
if (SHOW_RANDOM_CAT_IMAGE) {
$sql = "SELECT DISTINCT i.image_id, i.cat_id, i.user_id, i.image_name, i.image_description, i.image_keywords, i.image_date, i.image_active, i.image_media_file, i.image_thumb_file, i.image_download_url, i.image_allow_comments, i.image_comments, i.image_downloads, i.image_votes, i.image_rating, i.image_hits, c.cat_name".get_user_table_field(", u.", "user_name")."
FROM ".IMAGES_TABLE." i, ".CATEGORIES_TABLE." c
LEFT JOIN ".USERS_TABLE." u ON (".get_user_table_field("u.", "user_id")." = i.user_id)
WHERE i.image_active = 1 AND i.cat_id NOT IN ($cat_id_sql) AND c.cat_id = i.cat_id
ORDER BY RAND()";
$result = $site_db->query($sql);
while ($row = $site_db->fetch_array($result)) {
$random_image_cache[$row['cat_id']] = $row;
}
}
else {
if (empty($total_images)) {
$sql = "SELECT COUNT(*) as total_images
FROM ".IMAGES_TABLE."
WHERE image_active = 1 AND cat_id NOT IN ($cat_id_sql)";
$row = $site_db->query_firstrow($sql);
$total_images = $row['total_images'];
}
if (empty($total_images)) {
return $random_image_cache;
}
mt_srand((double)microtime() * 1000000);
$number = ($total_images > 1) ? mt_rand(0, $total_images - 1) : 0;
$sql = "SELECT i.image_id, i.cat_id, i.user_id, i.image_name, i.image_description, i.image_keywords, i.image_date, i.image_active, i.image_media_file, i.image_thumb_file, i.image_download_url, i.image_allow_comments, i.image_comments, i.image_downloads, i.image_votes, i.image_rating, i.image_hits, c.cat_name".get_user_table_field(", u.", "user_name")."
FROM ".IMAGES_TABLE." i, ".CATEGORIES_TABLE." c
LEFT JOIN ".USERS_TABLE." u ON (".get_user_table_field("u.", "user_id")." = i.user_id)
WHERE i.image_active = 1 AND i.cat_id NOT IN ($cat_id_sql) AND c.cat_id = i.cat_id
LIMIT $number, 1";
$random_image_cache[0] = $site_db->query_firstrow($sql);
}
return $random_image_cache;
}
function get_random_image($cat_id = 0, $show_link = 1, $return_file = 0) {
global $site_template, $random_image_cache;
if (!isset($random_image_cache)) {
$random_image_cache = get_random_image_cache();
}
if ($cat_id && SHOW_RANDOM_CAT_IMAGE) {
$template = 'random_cat_image';
$category_id = $cat_id;
}
else {
$template = 'random_image';
if (SHOW_RANDOM_CAT_IMAGE) {
srand((float)microtime() * 1000000);
$category_id = array_rand($random_image_cache);
}
else {
$category_id = 0;
}
}
if (!empty($random_image_cache[$category_id])) {
if (!$return_file) {
show_image($random_image_cache[$category_id], "", $show_link);
$random_image = $site_template->parse_template($template);
return $random_image;
}
else {
return get_file_path($random_image_cache[$category_id]['image_thumb_file'], "thumb", $category_id, 0, 1);
}
}
}
function format_file_size($file_size = 0) {
$file_size = intval($file_size);
if (!$file_size) {
return "n/a";
}
if (strlen($file_size) <= 9 && strlen($file_size) >= 7) {
$file_size = number_format($file_size / 1048576,1);
return $file_size." MB";
}
elseif (strlen($file_size) >= 10) {
$file_size = number_format($file_size / 1073741824,1);
return $file_size." GB";
}
else {
$file_size = number_format($file_size / 1024,1);
return $file_size." KB";
}
}
function get_remote_file_size($file_path) {
if (!CHECK_REMOTE_FILES) {
return 'n/a';
}
ob_start();
@readfile($file_path);
$file_data = ob_get_contents();
ob_end_clean();
return format_file_size(strlen($file_data));
}
function update_comment_count($image_id = 0, $user_id = 0) {
global $site_db, $user_table_fields;
if ($image_id) {
$sql = "SELECT COUNT(comment_id) AS comments
FROM ".COMMENTS_TABLE."
WHERE image_id = $image_id";
$countcomments = $site_db->query_firstrow($sql);
$sql = "UPDATE ".IMAGES_TABLE."
SET image_comments = ".$countcomments['comments']."
WHERE image_id = $image_id";
$site_db->query($sql);
}
if ($user_id != GUEST && $user_id && !empty($user_table_fields['user_comments'])) {
$sql = "SELECT COUNT(comment_id) AS comments
FROM ".COMMENTS_TABLE."
WHERE user_id = $user_id";
$countcomments = $site_db->query_firstrow($sql);
$sql = "UPDATE ".USERS_TABLE."
SET ".get_user_table_field("", "user_comments")." = ".$countcomments['comments']."
WHERE ".get_user_table_field("", "user_id")." = $user_id";
$site_db->query($sql);
}
}
function update_image_rating($image_id, $rating) {
global $site_db;
$sql = "SELECT cat_id, image_votes, image_rating
FROM ".IMAGES_TABLE."
WHERE image_id = $image_id";
$image_row = $site_db->query_firstrow($sql);
if (check_permission("auth_vote", $image_row['cat_id'])) {
$old_votes = $image_row['image_votes'];
$old_rating = $image_row['image_rating'];
$new_rating = (($old_rating * $old_votes) + $rating) / ($old_votes + 1);
$new_rating = sprintf("%.2f", $new_rating);
$sql = "UPDATE ".IMAGES_TABLE."
SET image_votes = ($old_votes + 1), image_rating = '$new_rating'
WHERE image_id = $image_id";
$site_db->query($sql);
}
}
function check_email($email) {
return (preg_match('/^[-!#$%&\'*+\\.\/0-9=?A-Z^_`{|}~]+@([-0-9A-Z]+\.)+([0-9A-Z]){2,4}$/i', $email)) ? 1 : 0;
}
function format_date($format, $timestamp) {
global $user_info;
$timezone_offset = (defined("TIME_OFFSET")) ? TIME_OFFSET : 0;
return date($format, $timestamp + (3600 * $timezone_offset));
}
function format_url($url) {
if (!preg_match("/^http:\/\//i", $url)) {
$url = "http://".$url;
}
if (!preg_match("/^https?\\:\\/\\/[a-z0-9\-]+\.([a-z0-9\-]+\.)?[a-z]+/i", $url)) {
$url = "";
}
return $url;
}
function replace_url($text) {
$text = " ".$text." ";
$url_search_array = array(
"#([^]_a-z0-9-=\"'\/])([a-z]+?)://([^, \(\)<>\n\r]+)#si",
"#([^]_a-z0-9-=\"'\/])www\.([a-z0-9\-]+)\.([a-z0-9\-.\~]+)((?:/[^, \(\)<>\n\r]*)?)#si"
);
$url_replace_array = array(
"\\1<a href=\"\\2://\\3\" target=\"_blank\">\\2://\\3</a>",
"\\1<a href=\"http://www.\\2.\\3\\4\" target=\"_blank\">www.\\2.\\3\\4</a>"
);
$text = preg_replace($url_search_array, $url_replace_array, $text);
if (strpos($text, "@")) {
$text = preg_replace("#([\n ])([a-z0-9\-_.]+?)@([\w\-]+\.([\w\-\.]+\.)?[\w]+)#i", "\\1<a href=\"mailto:\\2@\\3\">\\2@\\3</a>", $text);
}
return trim($text);
}
function replace_badwords($text) {
global $config, $split_badwords;
if ($config['badword_list'] != "") {
if (!isset($split_badwords)) {
$badwords = trim($config['badword_list']);
$badwords = preg_replace("/[\n\r]/is", " ", $badwords);
$badwords = str_replace(","," ",$badwords);
$badwords = preg_quote($badwords);
$badwords = str_replace('/', '\\/', $badwords);
$split_badwords = preg_split("/\s+/", $badwords);
}
foreach ($split_badwords as $key => $val) {
if ($val != "") {
if (substr($val, 0, 2) == "\\{") {
$val = substr($val, 2, -2);
$text = trim(preg_replace("/([^A-Za-z])".$val."(?=[^A-Za-z])/si", "\\1".str_repeat($config['badword_replace_char'], strlen($val)), " $text "));
}
else {
$text = trim(preg_replace("/$val/si", str_repeat($config['badword_replace_char'], strlen($val)), " $text "));
}
}
}
}
return $text;
}
function format_text($text, $html = 0, $word_wrap = 0, $bbcode = 0, $bbcode_img = 0) {
$text = trim($text);
if ($word_wrap && $text != "") {
$text = preg_replace("/([^\n\r ?&\.\/<>\"\\-]{".$word_wrap."})/i", " \\1\n", $text);
}
if ($html == 0) {
$text = str_replace("<", "&lt;", $text);
$text = str_replace(">", "&gt;", $text);
$text = str_replace("<", "<", $text);
$text = str_replace(">", ">", $text);
}
$text = str_replace("\n", "<br />", $text);
$text = replace_url($text);
if ($bbcode == 1) {
$search_array = array(
"/(\[)(list)(=)(['\"]?)([^\"']*)(\\4])(.*)(\[\/list)(((=)(\\4)([^\"']*)(\\4]))|(\]))/siU",
"/(\[)(list)(])(.*)(\[\/list\])/siU",
"/(\[\*\])/siU",
"/(\[)(url)(=)(['\"]?)(www\.)([^\"']*)(\\4])(.*)(\[\/url\])/siU",
"/(\[)(url)(=)(['\"]?)([^\"']*)(\\4])(.*)(\[\/url\])/siU",
"/(\[)(url)(])(www\.)([^\"]*)(\[\/url\])/siU",
"/(\[)(url)(])([^\"]*)(\[\/url\])/siU",
"/(\[)(code)(])(\r\n)*(.*)(\[\/code\])/siU",
"/javascript:/si",
"/about:/si"
);
$replace_array = array(
"<ol type=\"\\5\">\\7</ol>",
"<ul>\\4</ul>",
"<li>",
"<a href=\"http://www.\\6\" target=\"_blank\">\\8</a>",
"<a href=\"\\5\" target=\"_blank\">\\7</a>",
"<a href=\"http://www.\\5\" target=\"_blank\">www.\\5</a>",
"<a href=\"\\4\" target=\"_blank\">\\4</a>",
"<pre>Code:<hr size=1>\\5<hr size=1></pre>",
"java script:",
"about :"
);
$text = preg_replace($search_array, $replace_array, $text);
if (!$bbcode_img) {
$text = preg_replace("/(\[)(img)(])(\r\n)*([^\"]*)(\[\/img\])/siU", "<a href=\"\\5\" target=\"_blank\">\\5</a>", $text);
}
else {
$text = preg_replace("/(\[)(img)(])(\r\n)*([^\"]*)(\[\/img\])/siU", "<img src=\"\\5\">", $text);
}
$text = preg_replace("/(\[)(b)(])(\r\n)*([^\"]*)(\[\/b\])/siU", "<b>\\5</b>", $text);
$text = preg_replace("/(\[)(i)(])(\r\n)*([^\"]*)(\[\/i\])/siU", "<i>\\5</i>", $text);
$text = preg_replace("/(\[)(u)(])(\r\n)*([^\"]*)(\[\/u\])/siU", "<u>\\5</u>", $text);
}
$text = str_replace("\\'", "'", $text);
return replace_badwords($text);
}
function get_user_info($user_id = 0) {
global $site_db, $user_table_fields;
$user_info = 0;
if ($user_id != 0 && $user_id != GUEST) {
$sql = "SELECT *
FROM ".USERS_TABLE."
WHERE ".get_user_table_field("", "user_id")." = $user_id";
if ($user_info = $site_db->query_firstrow($sql)) {
foreach ($user_table_fields as $key => $val) {
if (isset($user_info[$val])) {
$user_info[$key] = $user_info[$val];
}
elseif (!isset($user_info[$key])) {
$user_info[$key] = "";
}
}
}
}
return $user_info;
}
function get_icq_status($uin) {
// From: http://www.koehntopp.de/php/snippets.html#code-icq
if (!is_numeric($uin)) return FALSE;
$fp = @fsockopen('wwp.icq.com', 80, $errno, $errstr, 8);
if (!$fp) return FALSE;
$request = "HEAD /scripts/online.dll?icq=$uin&img=5 HTTP/1.0\r\n"
."Host: wwp.icq.com\r\n"
."Connection: close\r\n\r\n";
fputs($fp, $request);
do {
$response = fgets($fp, 1024);
}
while (!feof($fp) && !stristr($response, 'Location'));
fclose($fp);
if (strstr($response, '4367')) return 'online';
if (strstr($response, '4349')) return 'offline';
if (strstr($response, '4386')) return 'disabled';
return FALSE;
}
function add_to_lightbox($id) {
global $user_info, $site_db;
$id = intval($id);
if (!$id) {
return false;
}
$lightbox_ids = $user_info['lightbox_image_ids'];
$lightbox_array = explode(" ", $lightbox_ids);
if (!in_array($id, $lightbox_array)) {
$lightbox_ids .= " ".$id;
}
$user_info['lightbox_image_ids'] = trim($lightbox_ids);
$user_info['lightbox_lastaction'] = time();
$sql = "UPDATE ".LIGHTBOXES_TABLE."
SET lightbox_lastaction = ".$user_info['lightbox_lastaction'].", lightbox_image_ids = '".$user_info['lightbox_image_ids']."'
WHERE user_id = ".$user_info['user_id'];
return ($site_db->query($sql)) ? 1 : 0;
}
function remove_from_lightbox($id) {
global $user_info, $site_db;
$lightbox_array = explode(" ",$user_info['lightbox_image_ids']);
foreach ($lightbox_array as $key => $val) {
if ($val == $id) {
unset($lightbox_array[$key]);
}
}
$user_info['lightbox_image_ids'] = trim(implode(" ", $lightbox_array));
$user_info['lightbox_lastaction'] = time();
$sql = "UPDATE ".LIGHTBOXES_TABLE."
SET lightbox_lastaction = ".$user_info['lightbox_lastaction'].", lightbox_image_ids = '".$user_info['lightbox_image_ids']."'
WHERE user_id = ".$user_info['user_id'];
return ($site_db->query($sql)) ? 1 : 0;
}
function clear_lightbox() {
global $user_info, $site_db;
$current_time = time();
$sql = "UPDATE ".LIGHTBOXES_TABLE."
SET lightbox_image_ids = '', lightbox_lastaction = $current_time
WHERE user_id = ".$user_info['user_id'];
if ($site_db->query($sql)) {
$user_info['lightbox_image_ids'] = "";
$user_info['lightbox_lastaction'] = $current_time;
return true;
}
else {
return false;
}
}
function check_lightbox($id) {
global $user_info;
$lightbox_array = explode(" ", $user_info['lightbox_image_ids']);
return in_array($id, $lightbox_array);
}
function get_random_key($db_table = "", $db_column = "") {
global $site_db;
$key = md5(uniqid(microtime()));
if ($db_table != "" && $db_column != "") {
$i = 0;
while ($i == 0) {
$sql = "SELECT ".$db_column."
FROM ".$db_table."
WHERE ".$db_column." = '$key'";
if ($site_db->is_empty($sql)) {
$i = 1;
}
else {
$i = 0;
$key = md5(uniqid(microtime()));
}
}
}
return $key;
}
function get_subcat_ids($cid = 0, $cat_id = 0, $cat_parent_cache) {
global $subcat_ids;
if (!isset($cat_parent_cache[$cid])) {
return false;
}
foreach ($cat_parent_cache[$cid] as $key => $val) {
if (check_permission("auth_viewcat", $val)) {
$subcat_ids[$cat_id][] = $val;
get_subcat_ids($val, $cat_id, $cat_parent_cache);
}
}
return $subcat_ids;
}
function get_subcategories($parent_id) {
global $cat_parent_cache, $cat_cache, $site_sess, $config;
if (!isset($cat_parent_cache[$parent_id]) || $config['num_subcats'] < 1) {
return "";
}
$visible_cat_cache = array();
foreach ($cat_parent_cache[$parent_id] as $key => $val) {
if (check_permission("auth_viewcat", $val)) {
$visible_cat_cache[$key] = $val;
}
}
$num_subs = sizeof($visible_cat_cache);
$sub_cat_list = "";
$i = 1;
foreach ($visible_cat_cache as $subcat_id) {
if ($i <= $num_subs && $i <= $config['num_subcats']) {
$sub_url = $site_sess->url(ROOT_PATH."categories.php?".URL_CAT_ID."=".$subcat_id);
$sub_cat_list .= "<a href=\"".$sub_url."\" class=\"subcat\">".$cat_cache[$subcat_id]['cat_name']."</a>";
if ($i != $config['num_subcats'] && $i < $config['num_subcats'] && $i < $num_subs) {
$sub_cat_list .= ", ";
}
if ($i == $config['num_subcats'] && $i < $num_subs) {
$sub_cat_list .= " ...\n";
}
}
$i++;
}
return $sub_cat_list;
}
function get_categories($cat_id = 0) {
global $site_template, $site_db, $site_sess, $config, $lang;
global $cat_cache, $cat_parent_cache, $new_image_cache, $subcat_ids;
$cattable_width = ceil((intval($config['cat_table_width'])) / $config['cat_cells']);
if ((substr($config['cat_table_width'],-1)) == "%") {
$cattable_width .= "%";
}
if (!isset($cat_parent_cache[$cat_id])) {
return "";
}
$visible_cat_cache = array();
foreach ($cat_parent_cache[$cat_id] as $key => $val) {
if (check_permission("auth_viewcat", $val)) {
$visible_cat_cache[$key] = $val;
}
}
if (empty($visible_cat_cache)) {
return "";
}
$total = sizeof($visible_cat_cache);
$table_columns = (intval($config['cat_cells'])) ? intval($config['cat_cells']) : 2;
if ($total <= $table_columns) {
$table_rows = 1;
}
else {
$table_rows = $total / $table_columns;
if ($total >= $table_columns && !is_integer($table_rows)) {
$table_rows = intval($table_rows) + 1;
}
}
$categories = "\n<table width=\"".$config['cat_table_width']."\" border=\"0\" cellpadding=\"0\" cellspacing=\"0\">\n<tr>\n<td valign=\"top\" width=\"".$cattable_width."\" class=\"catbgcolor\">\n";
$categories .= "<table border=\"0\" cellpadding=\"".$config['cat_table_cellpadding']."\" cellspacing=\"".$config['cat_table_cellspacing']."\">\n";
$count = 0;
$count2 = 0;
foreach ($visible_cat_cache as $key => $category_id) {
$categories .= "<tr>\n<td valign=\"top\">\n";
$is_new = (isset($new_image_cache[$category_id]) && $new_image_cache[$category_id] > 0) ? 1 : 0;
$num_images = (isset($cat_cache[$category_id]['num_images'])) ? $cat_cache[$category_id]['num_images'] : 0;
$subcat_ids = array();
get_subcat_ids($category_id, $category_id, $cat_parent_cache);
if (isset($subcat_ids[$category_id])) {
foreach ($subcat_ids[$category_id] as $val) {
if (isset($new_image_cache[$val]) && $new_image_cache[$val] > 0) {
$is_new = 1;
}
if (isset($cat_cache[$val]['num_images'])) {
$num_images += $cat_cache[$val]['num_images'];
}
}
}
if (defined("SHOW_RANDOM_IMAGE") && SHOW_RANDOM_IMAGE == 0 || defined("SHOW_RANDOM_CAT_IMAGE") && SHOW_RANDOM_CAT_IMAGE == 0) {
$random_cat_image_file = "";
}
else {
$random_cat_image_file = get_random_image($category_id, 0, 1);
}
$site_template->register_vars(array(
"cat_id" => $category_id,
"cat_name" => $cat_cache[$category_id]['cat_name'],
"cat_description" => $cat_cache[$category_id]['cat_description'],
"cat_hits" => $cat_cache[$category_id]['cat_hits'],
"cat_is_new" => $is_new,
"lang_new" => $lang['new'],
"sub_cats" => get_subcategories($category_id),
"cat_url" => $site_sess->url(ROOT_PATH."categories.php?".URL_CAT_ID."=".$category_id),
"random_cat_image_file" => $random_cat_image_file,
"num_images" => $num_images
));
$categories .= $site_template->parse_template("category_bit");
$count++;
$count2++;
$categories .= "</td>\n</tr>\n";
if ($count == $table_rows && $count2 < sizeof($visible_cat_cache)) {
$categories .= "</table></td>\n";
$categories .= "<td valign=\"top\" width=\"".$cattable_width."\" class=\"catbgcolor\">\n";
$categories .= "<table border=\"0\" cellpadding=\"".$config['cat_table_cellpadding']."\" cellspacing=\"".$config['cat_table_cellspacing']."\">\n";
$total = $total - $count2;
$table_columns = $table_columns - 1;
/*if ($total <= $table_columns && $table_columns > 1) {
$table_rows = 1;
}
else {
$table_rows = $total / $table_columns;
if ($total >= $table_columns && !is_integer($table_rows)) {
$table_rows = intval($table_rows) + 1;
}
}*/
$count = 0;
}
}
$categories .= "</table>\n</td>\n</tr>\n</table>\n";
return $categories;
}
function get_category_path($cat_id = 0, $detail_path = 0) {
global $site_sess, $config, $cat_cache, $url;
$parent_id = 1;
while ($parent_id) {
if (!isset($cat_cache[$cat_id]['cat_parent_id'])) {
return false;
}
$parent_id = $cat_cache[$cat_id]['cat_parent_id'];
if (empty($path)) {
if ($detail_path) {
$cat_url = ROOT_PATH."categories.php?".URL_CAT_ID."=".$cat_id;
if (preg_match("/".URL_PAGE."=([0-9]+)/", $url, $regs)) {
if (!empty($regs[1]) && $regs[1] != 1) {
$cat_url .= "&".URL_PAGE."=".$regs[1];
}
}
$path = "<a href=\"".$site_sess->url($cat_url)."\" class=\"clickstream\">".$cat_cache[$cat_id]['cat_name']."</a>";
}
else {
$path = $cat_cache[$cat_id]['cat_name'];
}
}
else {
$path = "<a href=\"".$site_sess->url(ROOT_PATH."categories.php?".URL_CAT_ID."=".$cat_id)."\" class=\"clickstream\">".$cat_cache[$cat_id]['cat_name']."</a>".$config['category_separator'].$path;
}
&nbs
-
bei der installation musste doch bestimmten ordner schreibrechte geben...
Bei Chmod 777 sollte es eigentlich bei dir klingeln...
Also schaue nochmal nach ob die Ordner die richtigen Rechte haben...
Suche mal nach:
$exif = exif_read_data ($media_src,'IFD0');
und
$exif = exif_read_data ($media_src,0,true);
und entferne das Leerzeichen...
-
Also die ganze PHP Function passte nicht in Thread ich habe sie also Kopiert und als Word Datei unter www.schulzhome.de/php.doc gelegt!
Klingeln?
Nun ich schein zu Doof zu sein was ist Chmod777 und wo gucke ich genau nach den echten in den Ordnern.
Entschuldigt bitte meine dummen frage aber ich glaube ich bin gerade hier dabei was zu lernen :D
Das mit den Vorschau Bildern hat doch sonst auch geklappt!
-
5. Setzen die angegebenen Zugriffsrechte für folgende Verzeichnisse:
chmod 777 (drwxrwxrwx) : data
chmod 777 (drwxrwxrwx) : data/database
chmod 777 (drwxrwxrwx) : data/media
chmod 777 (drwxrwxrwx) : data/thumbnails
chmod 777 (drwxrwxrwx) : data/tmp_media
chmod 777 (drwxrwxrwx) : data/tmp_thumbnails
chmod 777 (drwxrwxrwx) : templates
chmod 777 (drwxrwxrwx) : templates/default
chmod 777 (drwxrwxrwx) : templates/default/media
Setzen die angegebenen Zugriffsrechte für folgende Dateien:
chmod 666 (-rw-rw-rw-) : alle Dateien im Verzeichnis "templates/default"
chmod 666 (-rw-rw-rw-) : alle Dateien im Verzeichnis "templates/default/media"
Dies können Sie z.B. mit FTP-Programmen wie CuteFTP oder WS_FTP tun.
Also das musst Du machen und jeder neue Ordner wie zB /data/thumbnails/6/ und /data/media/6/ müssen auch chmod 777 haben und wenn das schon mal lief musste doch noch wissen wie Du es gemacht hast oder? (o:
Suche in der functions.php mal nach:
$exif = exif_read_data ($media_src,'IFD0');
und
$exif = exif_read_data ($media_src,0,true);
und entferne das Leerzeichen...
-
Habe ich gefunden:
$exif = exif_read_data ($media_src,'IFD0');
$bgcounter = 0;
if ($exif) {
$exif = exif_read_data ($media_src,0,true);
aber wo ist da jetzt ein Leerzeichen
-
$exif = exif_read_dataHIER($media_src,'IFD0');
$bgcounter = 0;
if ($exif) {
$exif = exif_read_dataHIER($media_src,0,true);
Noch fragen?
-
So das mit den LEERZEICHEN habe ich gemacht!
Noch Fragen?
Jaein
Ich habe das noch nie gemacht oder machen müssen,
ich habe die Page wo ich sie das erstemal aufgespielt habe nicht großartig geändert.
Erzeigte mir auch da keine Vorschau Bilder.
Habe dann die PHP Version geändert auf die jetzige und dann klappte das mit den Vorschaubildern.
Nun gut dann werde ich mich jetzt mal an die Chmod777 machen....
-
Fatal error: Call to undefined function: exif_read_data() in /mnt/ja2/07/460/00000013/htdocs/Album/includes/functions.php on line 399
FuntionPHP geändert aber immer noch diese Meldung!
Liegt das auch noch an Chmod777??
-
http://www.4homepages.de/forum/index.php?topic=3274.msg14916#msg14916
hatten dort das selbe problem...
-
So das wars.............
ich habe die Schn...Volllll :x
Ich schmeiß das Ding jetzt ganz runter!
Und baue Neu auf.
Danke für Eure Mühen und Eure Zeit ich ich muss erst noch ein Korsus besuchen
Ahhh aber das mit Chmod777 und 666 oder wie auch immer hatte ich gemacht brachte aber keine Abhilfe!
So ran ans Werk
-
Your server seems does not support EXIF:
http://php.net/manual/en/ref.exif.php
-
Hatte ich schon Erwähnt das mein Englisch nicht das Beste ist?
Habe alles noch mal Aufgespielt ganz Neu!
Nun die Vorschaubilder gingen wieder nur das die Benachrichtigung bei Kommentaren jetzt nicht mehr Funktioniert und da war doch noch was..............
Ach ja die Exif Daten werden Natürlich nicht angezeigt
Chmod777 chmod 666 Einstellungen haben nichts gebracht und auch nicht die Umstellung auf PHP 5.0 oder so...
Nun gebe ich es auf!
Suche mir eine andere Galerie.
@V@no:
Ein Englischer Text und ein Link zu einer Englischen seite bringen mir nicht, Schade.....
-
Das sollte Dir bei den englischenTexten helfen:
http://www.worldlingo.com/en/products_services/worldlingo_translator.html
Kommt zwar ab und an komisches Zeug bei raus aber es hilft wirklich... (o:
-
hi,
Gibts schon eine Möglichkeit die ISO von Nikon Cameras anzeigen zu lassen ?
es kommt immer nur eine NULL raus oder es wird garnicht angezeigt. :(
hier ein Beispiel:
Model: NIKON D70
Orientation: Normal
ExposureTime: 7692307/100000000 seconds
FNumber: F/7.1
ExposureBiasValue: 0 Step
MeteringMode: Spot
........ usw
Die Belichtungszeit sieht auch nicht wirklich Aussagefreundlich aus.
Aber die ISO würde mich mehr interessieren!
mfg Helge
-
@HelgeS
versuch mal auf einer anderen seite eine Liste zu finden mit allen zur verfügung gestellten Codes!
gruss
vincent
-
Hi,
ansich laufen die exif auf meiner kiste, doch sobald ich das mod benutze, erscheind bis jetzt nur eine kleine fehlermeldung
call to undefined function (exif_filter).... in zeile 405 ? (bin leider nicht zuhause um die genaue Meldung zu posten -g-).
v. 1.7.1
falls wer eine idee hat, wäre ich dankbar.
-
@vincent
Was für Codes brauchst du genau ?
Sag an , ich guck was ich besorgen kann.
Im Irfanview hab ich das auch erst anpassen müssen, da sich Nikon nicht an die "Norm" hällt.
Da habe ich ein Schrägtrich dazwischen gemacht um mal die normalen oder die Nikon anzeigen zu lassen.
Ist eben doof was Nikon macht.
Aber dein PlugIn ist besser wie garkeine Info !
Vielen Dank auch dafür
Wollte auch nur was dazu Anmerken um evtl meine Überlegung in ein Update einfliesen zu lassen.
:)
mfg Helge
-
@vincent
Ich hab eine Liste gefunden, weiss aber nicht ob die dir was hilft.
http://www.kadner-online.de/fotografie/exif/exifstandard2.pdf
Im Irfanview hab ich mir das so gebastelt: unter Einstellungen - Vollbild -
[Zeit] $E33434 [Blende] $E33437 [ISO] $E2/$E34855 [Blitz] $E37385 [Prg] $E34850 [Brennweite] $E37386 [Schärfe] $E41994 [Kontrast] $E41992 [Farbe] $E41993
und damit zeigt Irfan immer die ISOs an . Bei Nikon vor dem / .. und bei den anderen hinter dem / .
Vielleicht lässt sich ja was machen. Wär doch ne Idee für die neue Version
mfg Helge
-
Hi,
der Mod läuft bei mir soweit einwandfrei, dank vieler Tps und Hinweise hier!
Aber: Ist es möglich die Liste der Exif-Daten zu sortieren?
Die Reihenfolge der Daten unter den Bildern ist etwas konfus und ich möchte gern
z.Bsp: "FocalLengthIn35mmFilm" direkt unterhalb von "FocalLength" stehen haben usw.
Hat da jemand einen Lösungsansatz???
Danke!
Teddy
-
<?php
/*
4images EXIF MOD
Version : 0.3
Date: 2003-01-17
By: fatman (fatman_li@yahoo.com.hk)
*/
// true: enable the field filter
// false: disable the field filter
define('EXIF_CONTROL', true);
// add the field name for show in exif section
// remember the field name with the colon ":"
define('EXIF_FILTER', "
Model:
Orientation:
ExposureTime:
FNumber:
ISOSpeedRatings:
ExposureBiasValue:
MeteringMode:
Flash:
FocalLength:
ColorSpace:
");
function exif_filter_control() {
return EXIF_CONTROL;
}
function exif_filter($name) {
if (strpos(EXIF_FILTER, ($name . ":")) > 0) {
return true;
} else {
return false;
}
}
function exif_get_str_val($val) {
$val = (substr($val, 0, strpos($val, "/"))) / (substr($val, strpos($val, "/") + 1));
return $val;
}
function exif_parse_value($name, $val) {
switch($name) {
case "Orientation":
if($val==1) $val = "Normal";
if($val==2) $val = "Mirrored";
if($val==3) $val = "Upsidedown";
if($val==4) $val = "Upsidedown Mirrored";
if($val==5) $val = "90deg CW Mirrored";
if($val==6) $val = "90deg CCW";
if($val==7) $val = "90deg CCW Mirrored";
if($val==8) $val = "90deg CW";
break;
case "ResolutionUnit":
if($val==1) $val = "No Unit";
if($val==2) $val = "Inch";
if($val==3) $val = "Centimeter";
break;
case "YCbCrPositioning":
if($val==1) $val = "Pixel Array";
if($val==2) $val = "Datum Point";
break;
case "ExposureTime":
$val = $val . " seconds";
break;
case "FNumber":
$val = "F/" . exif_get_str_val($val);
break;
case "ExposureProgram":
if($val==1) $val = "Manual control";
if($val==2) $val = "Program normal";
if($val==3) $val = "Aperture priority";
if($val==4) $val = "Shutter priority";
if($val==5) $val = "Program creative(slow program)";
if($val==6) $val = "Program action(high-speed program)";
if($val==7) $val = "Portrait mode";
if($val==8) $val = "Landscape mode";
break;
case "ExifVersion":
$val = round($val / 100, 2);
break;
case "ComponentsConfiguration":
$val = bin2hex($val);
$val = str_replace("01","Y",$val);
$val = str_replace("02","Cb",$val);
$val = str_replace("03","Cr",$val);
$val = str_replace("04","R",$val);
$val = str_replace("05","G",$val);
$val = str_replace("06","B",$val);
$val = str_replace("00","",$val);
break;
case "CompressedBitsPerPixel":
$val = exif_get_str_val($val);
break;
case "ShutterSpeedValue":
$val = "1/" . round(pow(2, exif_get_str_val($val))) . " seconds";
break;
case "ApertureValue":
$val = "F/" . round(pow(sqrt(2), exif_get_str_val($val)),1);
break;
case "BrightnessValue ":
$val = exif_get_str_val($val);
break;
case "ExposureBiasValue":
if ((substr($val, 0, strpos($val, "/"))) == "0") {
$val = "0 Step";
} else {
$val = $val . " Step";
}
break;
case "MaxApertureValue":
$val = "F/" . round(pow(sqrt(2), exif_get_str_val($val)),1);
break;
case "SubjectDistance":
$val = exif_get_str_val($val) . " M";
break;
case "MeteringMode":
if($val==0) $val = "Unknown";
if($val==1) $val = "Average";
if($val==2) $val = "Center Weighted Average";
if($val==3) $val = "Spot";
if($val==4) $val = "Multi-spot";
if($val==5) $val = "Multi-segment";
if($val==6) $val = "Partial";
if($val==255) $val = "Other";
break;
case "LightSource":
if($val==0) $val = "Unknown";
if($val==1) $val = "Daylight";
if($val==2) $val = "Fluorescent";
if($val==3) $val = "Tungsten";
if($val==10) $val = "Flash";
if($val==17) $val = "Standard light A";
if($val==18) $val = "Standard light B";
if($val==19) $val = "Standard light C";
if($val==20) $val = "D55";
if($val==21) $val = "D65";
if($val==22) $val = "D75";
if($val==255) $val = "Other";
break;
case "Flash":
if($val==0) $val = "No Flash";
if($val==1) $val = "Flash fired";
if($val==5) $val = "Flash fired but strobe return light not detected";
if($val==7) $val = "Flash fired and strobe return light detected";
if($val==9) $val = "Undefined";
break;
case "FocalLength":
$val = exif_get_str_val($val) . " mm";
break;
case "FlashPixVersion":
$val = round($val / 100, 2);
break;
case "ColorSpace":
if($val==1) $val = "sRGB";
if($val=='65535') $val = "Uncalibrated";
break;
case "FocalPlaneXResolution":
$val = round(exif_get_str_val($val));
break;
case "FocalPlaneYResolution":
$val = round(exif_get_str_val($val));
break;
case "FocalPlaneResolutionUnit":
if($val==1) $val = "No Unit";
if($val==2) $val = "Inch";
if($val==3) $val = "Centimeter";
break;
case "SensingMethod":
if($val==2) $val = "1 chip color area sensor";
break;
case "FileSource":
$val = bin2hex($val);
if($val==0x03) $val = "Digital still camera";
break;
case "FileSource":
$val = bin2hex($val);
if($val==0x01) $val = "Directly photographed";
break;
}
return $val;
}
?>
haste mal versucht es hier drin zu sortieren?
-
Die Liste oben (unter Define Exif_Filter) kann man sortieren wie man will, es ändert sich nichts :(
oder wo meinst du ansonsten?
Gruß
Teddy
-
function exif_parse_value($name, $val) {
switch($name) {
dort die ganzen case dinger auch umsortieren?
-
function exif_parse_value($name, $val) {
switch($name) {
dort die ganzen case dinger auch umsortieren?
Hat auch nichts gebracht :(
-
Hallo,
ich habe alles soweit eingebaut, habe auch keine Fehlermeldung mehr aber....
Ich sehe nur bei mir auf der Seite:
IPTC Info
EXIF Info das wars, keine Felder mit Daten darunter ?
Woran liegt das ?
Grüße Darkness
-
also ich habe für die IPTC Infos einfach das Orginal benutzt, weil nach dem Watermark waren auch diese Infos immer wech...
Also lese ich jetzt die Infos aus dem big folder aus und zack ist alles wieder so wie es sein soll...
Habe das fürs EXIF noch nicht gemacht könnte mir das aber auch mal anschauen... (o:
-
wie gesagt noch habe ich kein EXIF im einsatz und auch IPTC nutze ich persönlich auch nicht... (o:
Aber ich schaue mir den Mod mal an und versuche es so zu frickeln das es mit dem big und ohne klappt...
EDIT:
Kannst Du mir vielleicht zugriff auf deinen Server geben? Dann könnte ich es dort gleich mal testen, weil alles selber auf ein Testsystem einzubauen und dann noch Bild mit EXIF Infos zuerstellen ist mir im Moment zu viel... *g*
Vielleicht reicht auch die functions.php... Ich würde sie ändern und du testest sie dann...
-
... eigentlich müsste dies 1/50s heissen ...
... nichts für ungut aber : 1/50s = 10/500s (wie im EXIF Info angezeigt)
-
Also wenn das immer der Fall ist kannste die Zeit ja durch 10 dividieren... (o:
-
es ist beides richtig!
1/50 = 10/500 =100/5000 = 1000/50000 usw.
Nur nimmt man dann eigentlich 1/50... (o:
Und die anderen Programme scheinen schlauer zu sein und die kürzen es gleich...
-
die ist nicht komplett... hänge das mal als zip an...
-
teste das mal...
Das teil schaut ob im big ordner die Datei vorhanden ist und nimmt dann die IPTC & EXIF Infos von der Datei...
Dann berichte mal ob es geklappt hat...
EDIT:
Achja du musst diese beiden Zeilen anpassen!
if (get_file_path($media_file_name, "media", $cat_id."/download", 0, 0 )){
$media_src_iptc = get_file_path($media_file_name, "media", $cat_id."/download", 0, 1);
Dort muss nämlich der Name des Big Ordners hin welchen Du gewählt hast... *g*
-
eigentlich sollte er das machen... Kann ich mir das bei dir mal anschauen?
Erzähle mal in welche Kategorie sind was für Bilder usw
Weil ich habe es eigentlich so gemacht das wenn das bild im Big folder ist dann nimm EXIF und IPTC vor dort und wenn es nicht vorhanden ist funzt es wie sonst auch... Dachte ich zumindestens... *g*
-
Jau mach das und seih so nett und benachrichtige mich noch mal per PN damit ich mir das auch anschauen was Du hier schreibst... *g*
-
From includes/functions.php file,
change :
$user_profile_link = (!empty($url_show_profile)) ? preg_replace("/{user_id}/", $image_row['user_id'], $url_show_profile) : ROOT_PATH."member.php?action=showprofile&".URL_USER_ID."=".$image_row['user_id'];
to :
$user_profile_link = (!empty($url_show_profile)) ? str_replace("{user_id}", $image_row['user_id'], $url_show_profile) : $site_sess->url(ROOT_PATH."member.php?action=showprofile&".URL_USER_ID."=".$image_row['user_id']);
Merry Christmas.
-
Thanx for this nice mod, now it works fine. (my 4th try to install now -g-)
-
Hallo,
ich möchte den Kommentar (COMMENT) aus der Bild-Datei mit auslesen lassen.
Wie kann ich das mit dem Script realisieren?
MfG, Rene
-
Hallo,
ich möchte den Kommentar (COMMENT) aus der Bild-Datei mit auslesen lassen.
Wie kann ich das mit dem Script realisieren?
Forgive me but ... would it be possible to post this request in english in order to have a better understanding ? ;)
-
Hi.
Attached you can find a diff against the original 4images 1.7.1 files. It can be easily applied (and reverted) by running:
patch -p1 < mod_EXIF-0.3_4images-1.7.1.patch.txt
You can also find the patch online on my site at http://alexander.skwar.name/4images-patches/mod_EXIF-0.3_4images-1.7.1.patch
Hope you like it,
Alexander Skwar
-
hello all was okay with my exif output until i changed my jpeg.html file, now i get this error on some images, anyone can help thanks
Warning: exif_read_data(artpictures__e6f2722.jpg): file to small (0) in /home/artpictu/public_html/gallery/includes/functions.php on line 429
-
until i changed my jpeg.html file
In that case, could you post your codings from jpeg.html file ? ;)
-
these were my changes
Replace
Code:
<img src="{media_src}" border="1" alt="{image_name}"{width_height} />
with:
Code:
<table style="background: url({media_src}) no-repeat; background-position: center center" cellpadding="0" cellspacing="0">
<tr>
<td><img src="{template_url}/images/spacer.gif" border="1" alt="{image_name}"{width_height} /></td>
</tr>
</table>
thanks
RT
-
Hum ... even I made this change in the past and I have to say it works perfectly. 8O
Strange. If you look into your web error logs, regarding this error message, what does it state ?
[ EDIT ]
I found it.
In your includes/functions.php file, replace this part :
exif_read_data(
with this one :
@exif_read_data(
;)
-
Hum ... even I made this change in the past and I have to say it works perfectly. 8O
Strange. If you look into your web error logs, regarding this error message, what does it state ?
[ EDIT ]
I found it.
In your includes/functions.php file, replace this part :
exif_read_data(
with this one :
@exif_read_data(
;)
thanks all okay now i replaced
exif_read_data(
twice with @exif_read_data(
:D
-
Outstanding, thanks for reporting this. ;)
-
hallo zusammen,
ich habe ein kleines problem bezüglich der exposuretime (belichtungszeit).
bei mir wird eine null zuviel angezeigt (siehe bild)
eigentlich müsste dies 1/50s heissen!
wer kann mir helfen?
danke
p.s habe mit zwei exif reader probiert und dasselbe ergebnis (eine null zuviel)
Damit kämfe ich auch noch. Allerdings nicht nur bei der Belichtungszeit sondern auch z.B. bei der Belichtungskorrektur. Gibt es eine Lösung? Ich konnte hier leider nichts dazu finden.
Danke für die Mühe.
Gruß Patrick
-
For Error Messaes like:
Warning: Unable to open 'http://www.***.de/test/1.jpg' in e:\www\4images\includes\functions.php on line 500
Beacuse of exif Function (exif_read_data) don't work on remote files,
this mod has to be modified in one line of funcitons.php
Search this line:
if ((($file_extension == "jpg") || ($file_extension == "jpeg")) &&($detailed_view)) {
and replace with:
if ((($file_extension == "jpg") || ($file_extension == "jpeg")) &&($detailed_view) && (!is_remote($media_file_name))) {
If it was already posted here,
then it would be good if it would also be modfied in the first post,
then its easier for people when installing the mod.
-
it would be good if it would also be modfied in the first post,
then its easier for people when installing the mod.
Done ;)
Btw, the file extension could not match with actual image format, so its better do a little different check ;)
-
Done ;)
thx
Btw, the file extension could not match with actual image format, so its better do a little different check ;)
its made,
cause the script is embedded in the functions.php and uses the 4images own image check.
Solution for wrong display of exposrure time
Cause it differs from camera modell the exposuretime is not correctly formated,
for values like 10/4000, which should be normally 1/400.
so i wrote a little modification.
you can use the modification also for other values, but then you have use the right variables.
Open includes/exif.php
search for:
$val = $val ." seconds";
replace it with:
$exposure_time=explode("/",$val);
if (($exposure_time[0]>9) AND (($exposure_time[1] % $exposure_time[0]) == 0)) {
$exposure_time[1] = $exposure_time[1]/$exposure_time[0];
$exposure_time[0] = $exposure_time[0]/$exposure_time[0];
}
$val = $exposure_time[0]."/".$exposure_time[1]." seconds";
then it should be displayed correctly.
Hope that helps.
-
Do you have idea have I can change this ExposureBiasValue: -2/6 Step like this -0.3???
I make that :)
case "ExposureBiasValue":
if ((substr($val, 0, strpos($val, "/"))) == "0") {
$val = "0 EV";
} else {
$valpieces = explode("/",$val);
$val = round(($valpieces[0] / $valpieces[1]), 1);
$val = $val . " EV";
}
break;
-
hi all,
i have a problem that was announced here before.
Warning: exif_read_data(dc_r.jpg): incorrect APP1 Exif Identifier Code in xxxx/gal/includes/functions.php on line 401
Warning: exif_read_data(dc_r.jpg): incorrect APP1 Exif Identifier Code in xxxx/gal/includes/functions.php on line 404
the error is only for some pictures :?
was there a solution posted which did not see?
any help/tip is welcome.
so far
stylawarz
-
Hallo,
einige kurze Fragen an den deutschsprachigen Teil der User hier (gerne auch an die englischsprachigen ;-) )
1. Hat jemand die ganzen EXIF-Angaben (inkl. möglichen Ergebnissen) schon mal übersetzt? Vieles ist einfach, aber etwa bei den Ergebnissen von "MeteringMode" bin ich mir nicht mehr sicher, wie die korrekte deutsche Übersetzung heißt. Und wo genau müsste man die Änderungen denn hinschreiben? In der exif.php finde ich die richtigen Stellen nicht.
2. Bei mir werden 10 EXIF-Infos angegeben - ist das kameraabhängig? Oder zeigt der Mod nicht mehr an?
3. Unter Flash erscheint bei mir, undefined, obwohl sicher gefeuert. Kamera 20D. Gibts da einen Fix?
Danke für Eure Hilfe!
-
@stylawarz:
I'm not quite the expert with EXIF but just wanted to let you all know there's an update release module from the manufacturer since January 12, 2006:
http://www.drewnoakes.com/code/exif/
Here's the fix logs :
http://www.drewnoakes.com/code/exif/ReleaseNotes.txt
Then, here's the sample output from the new release :
http://www.drewnoakes.com/code/exif/sampleOutput.html
Hope this helps.
-
1. Hat jemand die ganzen EXIF-Angaben (inkl. möglichen Ergebnissen) schon mal übersetzt? Vieles ist einfach, aber etwa bei den Ergebnissen von "MeteringMode" bin ich mir nicht mehr sicher, wie die korrekte deutsche Übersetzung heißt. Und wo genau müsste man die Änderungen denn hinschreiben? In der exif.php finde ich die richtigen Stellen nicht.
Die Exif Angaben werden gar nicht überssetzt,
sondern direkt aus den "Rohdaten" übernommen.
Du müsstest das direkt in der exif explizi machen,
dass jeweils ein dt. Titel angegeben wird.
Wie die jeweiligen korrekten Daten übersetzt heissen, findet man sicher im Web auf einschlägigen Seiten.
2. Bei mir werden 10 EXIF-Infos angegeben - ist das kameraabhängig? Oder zeigt der Mod nicht mehr an?
Bin mir nicht mehr 100% sicher, aber ich glaub der Mod liest nur bestimmte Daten aus.
3. Unter Flash erscheint bei mir, undefined, obwohl sicher gefeuert. Kamera 20D. Gibts da einen Fix?
Unter externen Programmen wird die Angabe aber richtig angezeigt?
Also mir z.b. auf windows laufenden exif reader progs?
-
Hallo IcEcReaM,
>Die Exif Angaben werden gar nicht überssetzt,
Das habe ich schon befürchtet.
Ich bin leider nicht so ein guter Coder - könnte man das vielleicht über eine Language-Datei oder eine Variablenliste zu Beginn der Datei bei einer nächsten Version einbauen - der Mod wird doch wie auch die Galerie international genutzt. Bin sicher nicht der Einzige, der es in der Landessprache darstellen will. Die Übersetzungen würd man wohl zusammentragen können, da kann ich gerne versuchen zu helfen.
>Bin mir nicht mehr 100% sicher, aber ich glaub der Mod liest nur bestimmte Daten aus.
Auch diese einzelnen Ausgaben (ob erwünscht oder nicht) könnte man vielleicht zu- und abschaltbar gestalten? Noch ein Wusnch für die nächste Version.
>Unter externen Programmen wird die Angabe aber richtig angezeigt?
Der Exifreader gibt bei einem exemplarischen Beispiel-JPG aus:
Flash : Fired
Der Mod gibt aus:
Flash: Undefined
Danke für Deine Hilfe.
-
// true: enable the field filter
// false: disable the field filter
define('EXIF_CONTROL', true);
// add the field name for show in exif section
// remember the field name with the colon ":"
define('EXIF_FILTER', "
Model:
Orientation:
ExposureTime:
FNumber:
ISOSpeedRatings:
ExposureBiasValue:
MeteringMode:
Flash:
FocalLength:
ColorSpace:
");
Für deine Erweiterungswünsche würde ich erstmal raten,
den Modschreiber selbst (am Besten per PN) anzuschreiben.
Wegen Punkt 2.
Das kannst du in der exif.php bestimmen,
ob bestimmte Werte gefiltert werden sollen,
und wenn ja welche.
Wegen deinem letzten Punkt, weiss ich derzeit leider auch nicht woran es liegen könnte.
Am besten hängst du mal gezippt ein Bild an deinen Post an, wo auf jeden Fall ein Blitz genutzt wurde.
-
Ist das der richtige Link?
http://www.4homepages.de/forum/index.php?topic=11072.msg58059#msg58059
-
Hallo IcEcReaM,
danke für den Hinweis zur Codeänderung.
>Für deine Erweiterungswünsche würde ich erstmal raten,
den Modschreiber selbst (am Besten per PN) anzuschreiben.
müsste ich wohl machen.
>Das kannst du in der exif.php bestimmen,
ob bestimmte Werte gefiltert werden sollen,
und wenn ja welche.
okay, geht (wie oben).
>Wegen deinem letzten Punkt, weiss ich derzeit leider auch nicht woran es liegen könnte.
Am besten hängst du mal gezippt ein Bild an deinen Post an, wo auf jeden Fall ein Blitz genutzt wurde.
Bitteschön (nicht über das Motiv wundern, es gibt keines ;-) )
-
hab das mal mit einigen von meinen Bildern verglichen.
Im exif.php Code gibt es genau 4 mögliche Werte
if($val==0) $val = "No Flash";
if($val==1) $val = "Flash fired";
if($val==5) $val = "Flash fired but strobe return light not detected";
if($val==7) $val = "Flash fired and strobe return light detected";
if($val==9) $val = "Undefined";
Interessanterweise steht bei meinen Bildern, wenn geblitzt wurde der Wert 89.
Insofern müsste man sich mal selbst mit dem Format auseinandersetzen,
was genau für exif Werte beim Blitzen dort gespeichert werden.
Edit:
http://www.stefanheymann.de/homegallery/exif-felder.htm
Hier ist auch ne kleine Liste, falls irgendwelche Übersetzungen benötigt werden.
-
Tag!
so die blitz funktion sollte nun korrekt funktionieren,
@IcEcReaM, ich habe von dir den code verwendet das bei einigen kameramodelen die belichtungszeit korrekt angezeigt wird, ich hoffe das macht dir nichts aus, wenn doch sag mir bescheid.
http://www.4homepages.de/forum/index.php?topic=11072.msg58059#msg58059
mfg Andi
-
Doch sofort löschen,
sonst überhäuf ich dich mit Klagen... :mrgreen:
Dafür hab ich den Code ja gepostet,
damit andere diese Problem auch lösen können..^^
-
Tag!
so ich habe die exifs wieder etwas modifiziert,
Belichtungsabweichung, Belichtungsmodus und Weißabgleich, b.z.w. in der letzten version auch den Blitz.
http://www.4homepages.de/forum/index.php?topic=11072.msg58059#msg58059
mfg Andi
-
Hab mir jetzt deinen Mod nicht genau angeschaut (vom Codding her, hab nur das Aussehen auf deiner Seite bewundert),
aber evtl. wäre es sinnvoll, das Ganze nochmal als eigenständigen Mod zu posten,
mit Überschrift, dass es ne dt. Version ist,
da es so viel mehr User erreicht, die sowas suchen.
P.S.: Ist das nur ne modifizierte Version von diesem Mod, oder nen komplett neu aufgesetzter?
-
Abend!
ist ein modifizierter, zusammengebastelt aus ein par foren, die modifizierten exifs sind von mir und einer von dir :mrgreen:
mfg Andi
-
na dann poste das Ganze doch einfach als eigenständigen Mod mit Hinweis darauf,
dass es ne dt. Version ist.
Gibt bestimmte einige, die sowas brauchen auf deutsch.
-
Hi,
ich kann euch nicht ganz folgen :oops:
Problem gelöst? Wenn ja, wie und wo?
-
Abend!
Hi,
ich kann euch nicht ganz folgen :oops:
Problem gelöst? Wenn ja, wie und wo?
hier
http://www.4homepages.de/forum/index.php?topic=11072.msg58059#msg58059
da gibt es eine zip datei von mir zum downloaden.
mfg Andi
-
Hallo Andi,
klappt wunderbar!
Danke Dir!!
-
Morgen!
jaa das wollte ich hören :)
viel spass noch..
mfg Andi
-
Hi everybody
I also get the following error message:
Warning: exif_read_data(32q_bild3.jpg): incorrect APP1 Exif Identifier Code in /home/httpd/vhosts/photofrontal.ch/httpdocs/includes/functions.php on line 504
What exactly do I have to do know? Download a metadata-extractor-2.3.1.jar file? For what is this file and where do I have to move this file?
Thanks!
TIMT
-
Hi!
@TIMT, welchen exifmod verwendest du?
mfg Andi
-
upsss :oops:
wie komme ich zu dieser Info?
-
Hi!
naja du wirst doch wissen welchen exifmod du dir installiert hast, oder?
ist das der den ich gepostet habe (exif mit deutscher übersetztung) ?
mfg Andi
-
ach so, das meinst du... ja, genau diesen habe ich installiert.
-
Hi!
so und was geht da jetzt nicht ?
lass dir nicht alles aus der nase ziehn :)
sonst unterhalten wir uns im sommer noch darüber, gib mal ein par infos.
mfg Andi
-
Sorry... eingentlich bin ich ja nicht so introvertiert.... :wink:
Abere soo viel mehr kann ich nicht erzählen.
Bei bestimmten Bildern in der Detailansicht bekomme ich folgende Fehlermeldung:
Warning: exif_read_data(32q_bild3.jpg): incorrect APP1 Exif Identifier Code in /home/httpd/vhosts/photofrontal.ch/httpdocs/includes/functions.php on line 504
Meldung erscheint am oberen Rand (nicht auf den ersten Blick zu erkennen, Scharz auf Grau).
Gruss
TIMT
-
Hi!
kann ich mal ein bild das diese fehlermeldung verursacht von dir dowloaden ?
mfg Andi
-
Hallo Rembrandt
Ich habe dir zwei der Fotos per Mail zukommen lassen.
Gruss
TIMT
Sorry... habe erst jetzt gesehen.. Rembrandt = Andi :wink:
-
Hi!
komisch das verhalten bei dem bild, ich denke das das photoshop elements bei dem bild etwas falsches hinneinschreibt,
wenn ich z.b. das bild mit der blume in photoshop öffne und wieder abspeichere funktioiniert es einwandfei.
bei deinem bild wird auch bei irfanview keine exifdaten angezeigt, bei anderen exifreadern wiederum schon.
hm.. versuche es mal, öffne das bild erneut in photoshop und speichere es nochmal ab, aber mit der funktion "speichern unter"
und nicht falls es das bei elements überhaupt gibt mit "für web speichern".
dein bild http://rembrandt.re.funpic.de/details.php?image_id=525
lösche ich wieder
mfg Andi
-
HELP!!!
It seems that i am loosing all the EXIF info while auto-resizing or auto-annotation..
What to do??
HELP :cry:
-
himu,
http://www.4homepages.de/forum/index.php?topic=12609.msg67600#msg67600
have a look there.
-
Hallo Andi
Ich habe bemerkt, dass das Originalbild OK ist.
Ich mache einen Resize mit ImageMagick. Das "neue" Bild erzeugt die Probleme.
Gruss
Serge
-
Morgen!
also ich sage dir mal wie ich es mache.
ich lege zuerst die ordner an damit ich weis welche Id sie haben.
meine fertigen bilder lade ich in Irfanview Batch-Konvertierung, und dort z.b. 800x600, die haken original zeit datum und exif auch setzten.
so wenn das erledigt ist lade ich die bilder mittels FTP hoch in die entsprechenden ordner, in der Galerie gehe ich dann noch auf neue Bilder checken und zum schluss auf Auto Tumbnailer.
in den den einstellungen habe ich die GD Bibliothek ausgewählt mit dem gibt es keine Probleme.
ich glaube einmal hier irgendwo gelesen zu haben das ImageMagick die exif killt bin mir das aber jetzt nicht sicher.
so vielleicht hilft dir das weiter.
mfg Andi
-
Hi
I changed IceCreams code for exposure time to this.
case "ExposureTime":
$exposure_time=explode("/",$val);
if ($exposure_time[0]>0) {
$exposure_time[1] = round($exposure_time[1]/$exposure_time[0]);
$exposure_time[0] = $exposure_time[0]/$exposure_time[0];
}
$val = $exposure_time[0]."/".$exposure_time[1]." seconds";
break;
The reason for that was because I got exposure times like 6.6666789 / 6.789999999
-
Hallo Andi
Vielen Dank für deine Ausführungen.
Bei mir laden verschiedene Fotografen die Bilder hoch.
Ich schalte die Bilder frei, kopiere die Originale in das Verzeichnis big und verkleinere die Bilder für die Präsentation im Internet.
Ich mache dies mit folgenden zwei Funktionen:
- Bilder freischalten
- Auto-Image-Resizer
Wenn ich wüsste, was genau das Problem ist, könnte ich die Fotografen entsprechend informieren / instruieren.
Hast du mir vielleicht noch einen Tipp?
Vielen Dank, Gruss
Serge
-
Âbend!
is doch unnötiger traffic was die verursachen, erst das original hochladen und du verkleinerst es dann.
sag ihnen die sollen sich irfanview runterladen ist freeware, dort haben sie auch eine batchkonvertierung, z.b. 800x600
haken setzen bei "proportional" "kleine bilder nicht vergrössern" und "resample funktion verwenden".
exif werden auch nicht verschluckt, und der bilderupload der fotografen geht auch schneller.
mfg Andi
-
Hallo Andi
Ich brauche aber die Originale.
Mit den Originalen drucke ich Karten bzw. biete die Bilder in digitaler Form zum Verkauf an.
Gruss
Serge
-
Âbend!
is doch unnötiger traffic was die verursachen, erst das original hochladen und du verkleinerst es dann.
sag ihnen die sollen sich irfanview runterladen ist freeware, dort haben sie auch eine batchkonvertierung, z.b. 800x600
haken setzen bei "proportional" "kleine bilder nicht vergrössern" und "resample funktion verwenden".
exif werden auch nicht verschluckt, und der bilderupload der fotografen geht auch schneller.
mfg Andi
nun in meinem Fall ändert Irfanview auch die Grösse der Datei im Exif - somit könnte man meinen das die original datei nur 800 ist!
gruss
vincent
-
Hi,
does anybody know, why I get the following warnigs on the detail page?
Warning: exif_read_data(32q_NeuschwansteinpanPostkarte_2.jpg): incorrect APP1 Exif Identifier Code in /home/httpd/vhosts/photofrontal.ch/httpdocs/includes/functions.php on line 504
Warning: exif_read_data(32q_NeuschwansteinpanPostkarte_2.jpg): incorrect APP1 Exif Identifier Code in /home/httpd/vhosts/photofrontal.ch/httpdocs/includes/functions.php on line 507
Warning: exif_read_data(32q_NeuschwansteinpanPostkarte_2.jpg): incorrect APP1 Exif Identifier Code in /home/httpd/vhosts/photofrontal.ch/httpdocs/includes/functions.php on line 504
Warning: exif_read_data(32q_NeuschwansteinpanPostkarte_2.jpg): incorrect APP1 Exif Identifier Code in /home/httpd/vhosts/photofrontal.ch/httpdocs/includes/functions.php on line 507
What can I do not displaying this messages?
Thanks!
-
Всем привет. Установил мод. Выдает такую ошибку:
Parse error: parse error, unexpected T_CONSTANT_ENCAPSED_STRING, expecting ')' in z:\home\foto\www\includes\functions.php on line 491
Кто нибудь может помочь? :oops:
Заранее большое спасибо!
-
Abend !
@Vincent, ist eh hinfällig da Timt die originale auch benötigt.
@TIMT, ich habe dir eh schon geschrieben das dieses "ImageMagick" anscheinend irgend einen müll in die Exif schreibt.
gibt es für die Galerie nicht ein anderes Prog. mit dem du die Bilder konvertieren kannst.
mfg Andi
-
Hallo Andi
Zuerst hatte ich GD aktiviert. GD eliminiert aber alle EXIF Informationen.
Das selbe Problem hatte icih mit NetPBM. Da blieb nur noch ImageMagick.
So wie es aussieht, kommt keines der Tools mit den EXIF Informationen klar.
-
Is the following error message an 4images error message? Can I find help in an imagemagick forum by showing this message?
Warning: exif_read_data(32q_DND_06_00609.jpg): incorrect APP1 Exif Identifier Code in /home/httpd/vhosts/photofrontal.ch/httpdocs/includes/functions.php on line 507
-
Abend!
schau dich dort mal um, vieleicht können die dir weiterhelfen.
mfg Andi
-
Hallo Andi
Ich habe bemerkt, dass die EXIF Daten NICHT verloren gehen. Sie werden mit 4images, mit photoimpact und mit photoshop angezeigt, nicht aber mit Irvan View.
Das Beispiel, das ich dir geschickt hatte, beinhaltete tatsächlich keine EXIF Daten.
Nun, die EXIF Daten werden angezeigt, die Meldung leider auch.... wie soll ich nun vorgehen? Hast du mir einen Tip?
Gruss
Serge
-
Hi!
hm.. also was mir noch einfällt, du könntest in der PHP.ini festlegen ob fehlermeldungen ignoriert od. angezeigt werden sollen.
red mal mit deinem provider.
mfg Andi
-
Hallo Andi
Mein Provider hat mir gesagt, ich könne die Meldung direkt im Script unterdrücken.
Das funktioniert, wenn ich in functions.php folgenden Code erfasse:
error_reporting(0);
Nun habe ich aber von PHP keine Ahnung. Was wären die Konsequenzen? Darf ich das so machen?
Hier gibt es noch mehr Infos betreffend error_reporting:
http://ch.php.net/error_reporting
Vielen Dank
Gruss
Serge
-
Abend!
na das ist einfach, den code gleich als erster einfügen.
vor der ersten zeile
" if (!defined('ROOT_PATH')) {"
nur wenn du weitere mods einbauen willst solltest du das vorher jedesmal rückgängig machen, denn wenn der mod einen fehler verursacht siehst du es nicht, aber ich denke solange du nichts änderst wird es ok sein.
mfg Andi
-
Who's willing to give me a hand here?
I would like to show exif info after 12 hours when image is being uploaded. I tried this code but the problem is in $image_row['image_date']
functions.php
$current_time = time();
$name_timeout = floor(($current_time - $image_row['image_date']) / 3600) ;
$exif_info .= ($name_timeout <= 12) ? "-" : $site_template->parse_template("exif_bit");
Does anyone have idea how do I get image_date?
-
Hallo Andi
Mein Provider hat mir gesagt, ich könne die Meldung direkt im Script unterdrücken.
Das funktioniert, wenn ich in functions.php folgenden Code erfasse:
error_reporting(0);
Nun habe ich aber von PHP keine Ahnung. Was wären die Konsequenzen? Darf ich das so machen?
Hier gibt es noch mehr Infos betreffend error_reporting:
http://ch.php.net/error_reporting
Vielen Dank
Gruss
Serge
einfach in die exif.php ganz oben im nicht auskommentierten teil einfügen. dazu musst du wirklich nix in der functions.php umbauen.
-
Hallo,
Ich habe mir diesen MOD installiert, aber habe damit ein kleines Problem.
Wenn ich in exif.php nichts auswahle, also:
// true: enable the field filter
// false: disable the field filter
define('EXIF_CONTROL', true);
// add the field name for show in exif section
// remember the field name with the colon ":"
define('EXIF_FILTER', "
");
dann sehe ich sowieso diese exif Dateit (ohne beschreibung):
Canon
Canon EOS 350D DIGITAL
1/200
F/7.1
100
07.06.2006 09:48:43
149mm
Was habe ich falsch gemacht?
Vielen Dank
Gruss
Pantograf
-
Tag!
falls du schon die vers. 1.7.3 installiert hast da gibt es schon eine exif version, nicht so ausführlich aber immerhin.
mfg Andi
-
Danke. Es ist alles in ordnung in dem code, aber ich kann den Namen (model, isospeed etc.) trotzdem nicht sehen. Was kann das sein?
Gruss
Pantograf
-
Abend!
kanst du mal ein bild irgendwo online stelln, wo ich das sehen kann?
mfg Andi
-
Hallo,
das Problem gibt's nicht mehr. Habe es selbst erloscht.
Danke fur die Hilfe
Grusse
Pantograf
-
Habe versucht GPS-Daten aus den Exif-Infos auszulesen und darzustellen, doch es klappt nicht ...
Grundlage dafür war die Exif and IPTC metadata library and tools (http://www.exiv2.org/tags.html) ...
Ich verwende die erweiterte deutsche Version "exif.php" von Rembrandt ...
Wäre nett, wenn mir ein Exif-Spezi hier mal auf die Sprünge helfen könnte ...
Meine Erweiterungen sehen bis jetzt so aus ...
1.Teil
define('EXIF_FILTER', "
...
GpsVer:
GpsLongitudeRef:
GpsLongitude:
GpsLatitudeRef:
GpsLatitude:
");
2.Teil
function exif_parse_value($name, $val) {
switch($name) {
...
case "GpsVer":
$val = $val;
break;
case "GpsLongitudeRef":
if($val==E) $val = "Ost";
if($val==W) $val = "West";
break;
case "GpsLongitude":
$val = $val;
break;
case "GpsLatitudeRef":
if($val==N) $val = "Nord";
if($val==S) $val = "Süd";
break;
case "GpsLatitude":
$val = $val;
break;
}
3.Teil
function exif_parse_name($name, $val) {
switch($name) {
...
case "GpsVer":
$name = "GPS Version";
break;
case "GpsLongitudeRef":
$name = "GPS Ref. geogr. Länge";
break;
case "GpsLongitude":
$name = "GPS geogr. Länge (Longitude)";
break;
case "GpsLatitudeRef":
$name = "GPS Ref. geogr. Breite";
break;
case "GpsLatitude":
$name = "GPS geogr. Breite (Latitude)";
break;
}
PS.:
... falls jemand fragen wollte ... ja die jpg-Dateien enthalten die GPSInfos in den Exif-Tags ... ;)
... es gibt dementsprechende Kameras bzw. auch Programme, die die GPSInfos in den Exif-Tags ablegen ...
... hier ein Bild der Frauenkirche (http://klick.kl.funpic.de/download/PICT1574.jpg) mit GPSInfos in den Exif-Tags ...
-
Abend!
könntest du mal ein jpg mit den gps daten zur verfügung stellen?
ich könnte mich dann mal damit befassen.
mfg Andi
-
... gefragt ... getan ... ;)
... habe oben ein Bild mit GPSInfos in den Exif-Tags angefügt ...
-
Abend!
so habe es, wird ein bischen dauern.
mfg Andi
-
Tag!
so hier ist eine vorab version mit dem GPS Infos.
erstens:
in der functions.php im abschnitt exif diese zeile
if (($key == "IFD0") || ($key == "EXIF") || ($key == "IFD1"))
um den wert GPS erweitern, das sieht dann so aus
if (($key == "IFD0") || ($key == "EXIF") || ($key == "IFD1") || ($key == "GPS"))
zweitens:
um jetzt die GPS daten richtig anzeigen zu können
(Breitengrad, Längengrad, Karten Datum, Koordinaten, GPS Datum und Uhrzeit)müssen wir noch in der exif.php diese funktionen hinzufügen
case "GPSLatitudeRef":
$val = $val;
break;
case "GPSLongitudeRef":
if($val==E) $val = "O";
if($val==S) $val = "S";
break;
case "GPSLatitude":
$val = exif_get_str_val($val[0]) ." ° ".exif_get_str_val($val[1])." ' ".exif_get_str_val($val[2])." ''";
break;
case "GPSLongitude":
$val = exif_get_str_val($val[0]) ." ° ".exif_get_str_val($val[1])." ' ".exif_get_str_val($val[2])." ''";
break;
case "GPSTimeStamp":
$val = exif_get_str_val($val[0]) .":".exif_get_str_val($val[1]).":".exif_get_str_val($val[2]);
break;
case "GPSDateStamp":
$val = $val;
$val = substr($val,8,2).".".substr($val,5,2).".".substr($val,0,4);
break;
case "GPSMapDatum":
$val = $val;
break;
drittens:
um die werte ins deutsche zu übersetzen kommen noch diese zeilen nach
switch($name) {
hinnein
case "GPSMapDatum":
$name = "GPS Kartendatum";
break;
case "GPSTimeStamp":
$name = "GPS Uhrzeit";
break;
case "GPSDateStamp":
$name = "GPS Datum";
break;
case "GPSLatitude":
$name = "Koordinate";
break;
case "GPSLongitude":
$name = "Koordinate";
break;
case "GPSLatitudeRef":
$name = "GPS Breitengrad";
break;
case "GPSLongitudeRef":
$name = "GPS Längengrad";
break;
und viertens:
damit wir wieder den filter anwenden können, dieses:
GPSLatitudeRef:
GPSLongitudeRef:
GPSLatitude:
GPSLongitude:
GPSTimeStamp:
GPSDateStamp:
GPSMapDatum:
ich werde wenn ich zeit habe das ganze noch ein bischen verschönern.
soda das wars, wünsche anregungen und keine beschwerden :) hier rein.
viel spass damit
Andi
-
Hallo Andi,
... zunächst ... DANKE für deine promte Antwort ... :)
... als ich deinen 1.Schritt gelesen habe ... da fielen mir die Schuppen von den Augen ... na klar, da lag der Fehler ...
... jetzt funktioniert es bestens, zu testen hier (http://klick.kl.funpic.de/details.php?image_id=3599) ...
... Hinweis zu den Referenzen ...
case "GPSLatitudeRef":
if($val==N) $val = "N (nördlicher Breite)";
if($val==S) $val = "S (südlicher Breite)";
break;
case "GPSLongitudeRef":
if($val==E) $val = "O (östlicher Länge)";
if($val==W) $val = "W (westlicher Länge)";
break;
Eine Frage noch : Wie kann man die Werte für Latitude und Longitude in dezimaler Schreibweise darstellen ... ?
Edit :
... Antwort siehe unten ... ;)
-
Tag!
wie jetzt, meinst du ohne grad minuten sekunden zeichen?
mfg Andi
-
... die Darstellung der lon/lat-Werte in deiner Version erfolgt (so wie in der ExifInfo gespeichert) in AltGrad ...
... d.h. z.B.: N 48° 8.99' 0'' (Grad/Minuten/Sekunden ... AltGrad) ...
... für die Weiterverwendung dieser Daten z.B. in Google Maps benötigt man sie aber in NeuGrad (dezimal) ...
... d.h. z.B.: N 48.1498333333 (NeuGrad) ...
... die Daten müssen dann also noch dementsprechend umgerechnet werden ...
... und das funktioniert nun bestens, zu testen hier (http://klick.kl.funpic.de/details.php?image_id=3599) ...
-
Abend!
na sieht doch super aus, vielleicht wird ja aus dem alten Exif mod doch noch etwas.
das werd ich mir auch gleich mal einbinden :)
DANKE!
das nächste was ich in angriff nehme will sind die "MakerNotes"
mfg Andi
-
Hallo!
Ich benutze auch den EXIF-Mod, allerdings mit der Version 1.7.3 und da EXIF Dateien schon standarisiert sind, werden manchen Werte doppelt angezeigt,
siehe Screenshot hier: http://www.4homepages.de/forum/index.php?topic=15847.0
Wie bekomm ich die Doppelten weg?
Hab auch schon probiert das hier aus der functions.php zu löschen:
function get_exif_info($exif) {
$exif_match = array();
$exif_match['Make'] = "make";
$exif_match['Model'] = "model";
$exif_match['DateTimeOriginal'] = "datetime";
$exif_match['ISOSpeedRatings'] = "isospeed";
$exif_match['ExposureTime'] = "exposure";
$exif_match['FNumber'] = "aperture";
$exif_match['FocalLength'] = "focallen";
$exif_array = array();
if (is_array($exif)) {
foreach ($exif as $key => $val) {
if (isset($exif_match[$key])) {
$exif_info = $val;
if ($key == "DateTimeOriginal") {
$exif_array[$exif_match[$key]] = preg_replace("/([0-9]{4}):([0-9]{2}):([0-9]{2})/", "\\3.\\2.\\1", $exif_info);
}
elseif ($key == "ExposureTime") {
$exposure = explode("/", $exif_info);
$exif_array[$exif_match[$key]] = "1/" . ($exposure[1] / $exposure[0]);
}
elseif ($key == "FNumber") {
$aperture = explode("/", $exif_info);
$exif_array[$exif_match[$key]] = "F/" . ($aperture[0] / $aperture[1]);
}
elseif ($key == "FocalLength") {
$focalLen = explode("/", $exif_info);
$exif_array[$exif_match[$key]] = ($focalLen[0] / $focalLen[1]) . "mm";
}
else {
$exif_array[$exif_match[$key]] = $exif_info;
}
}
}
}
return $exif_array;
}
dann ging aber gar nix mehr :lol:
EDIT: und wie ist es eigentl. möglich in der exif.php Informationen zuzufügen und auszuschliesen? z. B. Info über den Kamerahersteller
Gruß
Phil
-
Abend!
schau dir mal die zeile 504 ,524 an da steht auch noch was drinnen.
wenn du aber sagst das danach gar nichts mehr angezeigt wurde, dann funktioniert ja der exif mod bei dir nicht.
zu exif.php, dort hast du ja die filter funktion.
mfg Andi
-
Hallo!
Doch der Mod geht, hab's geschafft das Problem selbst zu lösen.
Trotzdem danke!
Gruß
Phil
-
Hallo,
habe den EXIF 0.3 MOD mit der GPS-Erweiterung auf eine 1.7.4 gespult.
Folgendes Problem:
Bei einigen Bildern werden EXIF und enthaltene GPS-Daten korrekt angezeigt.
Bei anderen erhalte ich eine Fehlermeldung und das EXIF-Feld bleibt komplett leer.
Beispiele:
korrekt:
Anzeige EXIF:
EXIF Info
ImageDescription: 2007-01-24_13-50-46_063.jpg
Kamera Hersteller: Canon
Kamera-Modell: Canon DIGITAL IXUS 750
Ausrichtung: Normal
XResolution: 1800000/10000
YResolution: 1800000/10000
Auflösungseinheit: Inch
Software: RoboGEO v5.0.12
Bearbeitet am: 25.01.2007 - 07:14:27 Uhr
YCbCrPositionierung: Pixel Array
Exif_IFD_Pointer: 158
GPS_IFD_Pointer: 512
Belichtungszeit: 1/160 Sekunde
Blende: F/3.5
Exif Version: 2.21
Aufnahme Datum und Zeit: 24.01.2007 - 13:50:47 Uhr
Digitalisiert am: 24.01.2007 - 13:50:47 Uhr
Komponentenkonfiguration: YCbCr
Komprimierte Bits pro Pixel: 5
Verschlussgeschwindigkeit: 1/159 Sekunden
Blendenöffnungswert: F/3.6
Belichtungsabweichung: 0 EV
Maximaler Blendenöffnungswert: F/3.5
Belichtungsmessung: Multi-Segment
Blitz: Blitz nicht ausgelöst
Brennweite (Objektiv): 13 mm
FlashPix-Version: 1
Farbraum: sRGB
ExifImageWidth: 800
ExifImageLength: 600
InteroperabilityOffset: 880
X Auflösung der Brennebene: 10817
Y Auflösung der Brennebene: 10817
Auflösungseinheit der Brennebene: Inch
Sensor Type: 1 chip color area sensor
Datei Quelle: Digital still camera
CustomRendered: Normal
Belichtungsmodus: Automatisch
Weißabgleich: Automatisch
DigitalZoomRatio: 3072/3072
SceneCaptureType: Standard
GPSVersion:
Fehler
Fehlermeldungen bei details.htm:
Warning: exif_read_data(2007-01-31_15-25-42_055.jpg): illegal IFD offset in xxx/includes/functions.php on line 530
Warning: exif_read_data(2007-01-31_15-25-42_055.jpg): illegal IFD offset in xxx/includes/functions.php on line 533
functions.php
Zeile 530:
$exif = exif_read_data($media_src,'IFD0');
Zeile 533:
$exif = exif_read_data($media_src,0,true);
EXIF-Ausgabe:
EXIF Info
Kamera Hersteller:
Kamera-Modell:
Ausrichtung:
XResolution:
YResolution:
Auflösungseinheit:
Software:
Bearbeitet am:
YCbCrPositionierung:
Exif_IFD_Pointer:
GPS_IFD_Pointer:
Belichtungszeit:
Blende:
Exif Version:
Aufnahme Datum und Zeit:
Digitalisiert am:
Komponentenkonfiguration:
Komprimierte Bits pro Pixel:
Verschlussgeschwindigkeit:
Blendenöffnungswert:
Belichtungsabweichung:
Maximaler Blendenöffnungswert:
Belichtungsmessung:
Blitz:
Brennweite (Objektiv):
MakerNote:
FlashPix-Version:
Farbraum:
ExifImageWidth:
ExifImageLength:
InteroperabilityOffset:
X Auflösung der Brennebene:
Y Auflösung der Brennebene:
Auflösungseinheit der Brennebene:
Sensor Type:
Datei Quelle:
CustomRendered:
Belichtungsmodus:
Weißabgleich:
DigitalZoomRatio:
SceneCaptureType:
GPSVersion:
GPS Breitengrad:
Koordinate:
GPS Längengrad:
Koordinate:
GPSAltitudeRef:
GPSAltitude:
GPS Uhrzeit:
GPS Kartendatum:
GPS Datum:
Hersteller:
Modell:
Belichtungszeit:
Blende:
Aufnahmedatum:
Brennweite:
EDIT: Bilddateien entfernt (beim Kleinrechnen gingen die EXIF-Infos verloren)
-
... die Daten müssen also wie folgt umgerechnet werden ...
Degrees Minutes Seconds to Degrees Minutes.m
Degrees = Degrees
Minutes.m = Minutes + (Seconds / 60)
...
Degrees Minutes.m to Decimal Degrees
.d = M.m / 60
Decimal Degrees = Degrees + .d
Hi Mawenzi,
verrätst Du, WO und mit welchem Code Du diese Umrechnung realisierst?
Grüße
COMmander
-
Âbend!
verrätst Du, WO und mit welchem Code Du diese Umrechnung realisierst?
in der exif.php
hast du auch die exif version die schon in der 1.7.4 enthalten ist rausgelöscht?
das mußt du auf jeden fall machen.
ausserdem sind in deinen beispielbilder entweder keine, oder fehlerhafte exif einträge.
EDIT: ahh habs überlesen, es funktioniert eh bei dir bis auf diese beiden beispielbilder.
mfg Andi
-
How do I add/remove some of the information displayed? There were some German posts but I could not understand them.
I am running this on 1.7 and it seems to work fine.
however it is not displaying "Date Picture Taken" information from the picture. It only shows the date I added the picture under 4images details.
How can I add "Date Picture Taken" attribute to the list? I tried so search for Date in this topic, but could not see anything.
Yes, my pictures carry this attribute on them, but it is not being displayed.
The field for this is "DateTimeOriginal" or "DateOriginal" I think.
Any help is appreciated.
Thank You
-
I want to create my gallery similar to wireimage.com can this be done with this Mod ?
Need help to add the Exif fields only: Header, Description, Date, Place, Photographer.
Any idea of how to do this for my 4images homepage, then 4images thumbnails and for the 4images details page ?. Any example please?
Thanks.
-
For example:
http://img387.imageshack.us/img387/9879/design2ix3.jpg
-
What you are asking about is THEME/TEMPLATE related, not EXIF MOD related.
If you can use the same template, you can put Exif info anywhere you want in that templete.
PLUS, the portion where you say "Photo Exif Info" is not exif information, it is just customized file information, which you can possibly achieve by modifying 4images db fields for image attributes (date/time/download/file name/ etc..) so you can add them when you upload the image.
-
Tag!
For example:
infringement of a copyright?!?!
mfg Andi
-
Photo Exif Info it will be the fields in the Metada info like: IPTC Image, IPTC Creator, IPTC Content, IPTC Status
so all that info is in the JPG ExifWhat you are asking about is THEME/TEMPLATE related, not EXIF MOD related.
If you can use the same template, you can put Exif info anywhere you want in that templete.
PLUS, the portion where you say "Photo Exif Info" is not exif information, it is just customized file information, which you can possibly achieve by modifying 4images db fields for image attributes (date/time/download/file name/ etc..) so you can add them when you upload the image.
Im not asking about the template design but exif info how to integrate it to the template and If can be done selecting just some fields.
If you said it's not "Photo Exif Info" is not exif information so it must be Metada info? all that can be embedded in the JPG file using
Adobe Bridge or Adobe Lightroom.
-
Caption, headline, venue, location, etc..
I don't think you can add these to exif.
you just have to modify 4images to add these attributes to DB along with whatever else you want to be there, you would include these when you upload the pix. Just like you would specify name, details, keywords, etc..
-
Or use other photo gallery script that full supports 100% exif info. I found one that is called Gallery.
-
OR use the latest version of 4images...
Anyway GOOD LUCK.
-
I don`t understand german so I want to ask you how to extract these:
Camera Model
Shutter Speed
Lens Aperture
Focal Lenght
Exposure Time
ISO Speed and other more
from EXIF info of the image. I`m using the latest 1.7.4 version of 4images
-
I want to extract date/time picture was taken. I am sure it is up there somewhere in German, but need in English, if possible. :(
-
hi hab die anleitung befolgt allerdings bekomm ich eine fehlermeldung
Fatal error: Call to undefined function: exif_read_data() in /home/www/cwcity/hosting/b/l/blubba/htdocs/bla/4images/includes/functions.php on line 526
wie kann ich die lösen?
dass er dort versucht ne Funktion aufzurufen, die nicht existiert sehe ich , aber kenn mich mit php zuwenig aus um das selbst zu lösen.
kann mir da jemand einen workaround geben ?
Danke Chris
(hab die 1.74)
-
PLEASE tell us in ENGLISH how to extract all EXIF info from the image.
-
Guten Tag
ich möchte gerne in der Detail ansicht direkt unterhalb des fotos haben
http://www.foto-kocher.com/details.php?image_id=3896
beim Beispiel zwischen Foto und Lightbox und Ecard usw
Darstellung in einer Linie
Firma ¦ Model ¦ Blende ¦ Zeit ¦ Objektiv ¦ Focal Length ¦ ISO
Vielen Dank für die Hilfe und Infos
gruss
Vincent
---englisch -----
Hello
i would like to have in the detail.php just below of the picture the folowing information
the information have to be just below the picture
http://www.foto-kocher.com/details.php?image_id=6373
in the example between Photo and Lightbox button
the following information should be added
Company ¦ Model ¦ Aperture ¦ Exposure time ¦ Lens ¦ Focal length ¦ ISO
Thanks for any help and information
sincerly
vincent
-
ooopss dein server scheint down zu sein! :wink:
gruss
vincent
-
Hallo
Ich dachte die Kamerainfos (EXIF) würden jedesmal ausgelesn und nicht in eine Datenbank gelegt :roll: :?
sonst meinte ich etwas wie hier
http://pixel-peeper.com/lenses/?lens=1011&perpage=12&focal_min=none&focal_max=none&aperture_min=none&aperture_max=none&res=3
gruss
vincent
-
up
-
Hallo,
habe am Wochenende Google Map in die Gallery integriert. Es werden die GPS Exif Informationen ausgelesen und wenn vorhanden, in einer Google Map dargestellt.
Nähere Infors hier:
http://www.4homepages.de/forum/index.php?topic=18046.0 (http://www.4homepages.de/forum/index.php?topic=18046.0)
Würde mich über Feedback freuen.
Grüße
Erik
-
Abend!
das rad hättest nicht neu erfinden müßen :)
http://www.4homepages.de/forum/index.php?topic=3274.225
mfg Andi
-
Hallo Zusammen!
Ich habe eine Frage bezüglich EXIF & [MOD] Auto resize on upload:
Wenn ich ein Bild uploade, welches EXIF & IPCT Daten besitzt, dann werden durch das Verkleindern des Bildes die Daten "gelöscht".
Ich nehme dadurch mal an, dass die GD Bibliothek dies löscht.
Ist es irgendwie möglich, dass diese Daten nach der automatischen Konvertierung (Auto Resize = ON) von einem Bild gespeichert bleiben resp. wieder beim Bild "angehängt" werden.
Gibt es da eine vernünftige, einfach Alternative? Wenn möglich ohne DB (ausgenommen natürlich Temporär Abspeicherungen...).
Eine Software-Lösung auf dem PC kann nur für mich verwendet werden, aber nicht für alle anderen Users.
Wie macht ihr das so? Habt ihr eine gute Lösung dafür?
Ich verwende u.a.:
Vers 1.7.6. & GD Bibliothek & [MOD] Auto resize on upload
Vielen Dank im Voraus.
Grüsse Jones
-
Hallo scluzern,
ich mache es extern und benutze Traumflieger früher bekannt als jpgcompressor.
Damit erhalte ich mir die Exif Daten.
www.traumflieger.de
nobby
-
@scluzern
... es ist nun mal so, wenn man die Bilder mit GD Bibliothek anfässt, dann sind die Exif-Infos dahin ...
... und das hat nichts mit 4images zu tun, sondern liegt allein an der serverseitigen GD Bibliothek ...
... aber es gibt eine Lösung dafür ...
... der Ansatz dafür ist zu finden hier ... http://www.4homepages.de/forum/index.php?topic=20496.0 ...
Prinziplöung Exif-Infos bei Image-Resizing :
1. Upload des Original-Bildes ...
2. Resizing zum Medium-Bild und Thumbnail , speichern dieser Bilder in den entsprechenden Ordnern ...
3. Speichern des Original-Bildes im Big-Ordner ...
( Funktionsweise Pkt. 1-3 wird im o.g. Link erklärt ... )
4. Auslesen der Exif-Daten nicht aus dem Medium-Bild (4images-Standard), das auf der Detail-Seite gezeigt wird und resized ist und damit keine Exif-Infos mehr enthält, sondern aus dem unveränderten und gespeicherten Big- / Original-Bild ... durch Pfadänderung im EXIF-Bereich der /includes/functions.php ...
5. d.h. man hat ein kompaktes Medium-Bild auf der Detailseite ... und trotzdem Exif-Infos ... ausgelesen eben aus dem Original-Bild ...
6. das ganze funktioniert dann natürlich ohne DB-Erweiterung ... und bestens ... !
... :wink: ...
... ich gehe davon aus, das du das Ergebnis bereits getest hattest ... :mrgreen:
-
Vielen Dank für deine promte Antwort. Ich habe mir es so gedacht, aber nicht gewusst wie das machen...
Ich habe es so gemacht (wie beschrieben) und es funktioniert bestens...
Diese Methode frisst einfach viel Speicherplatz, aber es gibt ja keine bessere Alternative. Sonst müsste man es von Hand verkleinern ;)
Habe es sogar so gemacht, dass zuerst die EXIF Daten von der normalen Datei gesucht werden und falls dort nichts vorhanden ist, dann wird es zu der big-Datei verlinkt.
Ich habe nirgends gesehen, dass im ACP nur nach Bilder gesucht werden kann, welche auch eine big-Datei haben.
Dies wäre noch eine gute Möglichkeit, dann könnte man später diese big-Bilder wieder finden (z.B. in "Bilder bearbeiten").
Gruss Jones
-
Hallo,
ich habe nach ermüdender Suche hoffentlich nichts übersehen.
In der Version 1.7.6 gibt es bereits EXIF Informationen. Wenn ich nun diesen MOD hier einbaue, dann vermischen sich die deutschen Informationen mit den englischen aus dem MOD.
Kann ich entweder die standardmäßigen Infos von 4Images selber erweitern, und - wenn nein - kann ich sie ganz abschalten und die Informationen aus EXIF eindeutschen?
Grüße,
Rüdiger
-
Tag!
ich habe die original rausgelöscht.
und der mod hat aber auch eine deutsche übersetztung.
http://www.4homepages.de/forum/index.php?topic=11072.msg58059#msg58059
mfg Andi
-
Hallo und danke für den Tipp. Verrätst Du einem noch etwas Unsicherem, was ich genau tun muss, um die Originale zu entfernen?
Gruß,
Rüdiger
-
wenn du die 1.7.6 version hast, ist die funktions.php in den oben angeführten link enthalten.
aber sicher dir deine funktionins.php trotzdem vorher.
mfg Andi
-
Hallo Rembrandt,
danke, ist gut gemeint. Aber wie soll ich bei den schon zahlreichen Modifikationen meiner functions.php rausbekommen, was ich jetzt an der hier mitgebrachten ändern muss, dass all die anderen Dinge noch funktionieren?
Ich wollte doch eigentlich nur wissen, wo ich die Original - Informationen löschen muss?
Gruß,
Rüdiger
-
Hi!
dort liegen die exif für die thumbnails drinnen, ich glaube das kannst du weglassen.
das habe ich damals reingeschrieben weil ich dachte das man es vielleicht braucht.
hast keine lust auf die neue version?
mfg Andi
-
ja ich verwende ja auch diesen mod http://www.4homepages.de/forum/index.php?topic=18046.0
das heist die googlemap wird angezeigt und alles in die datenbank geschrieben.
die googlemap und exif funktionieren auch ohne DB den die exif werden aus dem bild ausgelesen und nicht aus der DB.
die DB wird nur benötigt um nach den exif zu suchen.
ich habe leider nur ein bild von @mawenzi und da weis ich nicht ob ich das veröffentlichen darf.
wenn du ein bild mit den GPS hast was ich online stellen kann dann könnte ich es dir zeigen.
mfg Andi
-
Hi!
ja so einen gps tagger muß ich mir auch noch zulegen.
die exif suche kannst ausprobieren die kategorie "Motocross Karolinwerk i2007" ist nach exifdaten durchsuchbar.
mfg Andi
-
hm... stimmt, wenn man die exif felder wählt funktioniert es, mit den standardfeldern nicht.
vielleicht habe ich bei den standardfeldern was ausgehebelt, das muss ich mir ansehn.
mfg Andi
EDIT: habs gefunden schlampikeitsfeher von mir, jetzt funktioniert es.
ich werde das gleich dort richtigstellen.
THX @ivan!
ein testbild unter dem ordner "Test" habe ich online gestellt.
-
@ alle Exif-Spezialisten ... insbesondere @Rembrandt ... ;)
... ich muss ein etwas älteres Exif-Thema aufgreifen, die GPS-Exif-Daten ...
... grundlegend und basierend hierdrauf ...
- http://www.4homepages.de/forum/index.php?topic=3274.msg84606#msg84606
- http://www.4homepages.de/forum/index.php?topic=3274.msg84661#msg84661
... analog zu diesen Lösungsansätzen hatte ich die GPS-Daten noch um den Wert "GPSAltitude" erweitert ...
... bis zum heutigen Tag war damit die Welt auch noch in Ordnung, da ich nur GPS-Bilder oberhalb des Meeresniveaus auf meiner Seite hatte ...
... als normaler Mitteleuropäer denkt man, so glaube ich zumindest, auch nicht anders bzw. weiter ...
... doch gibt es auch Landstriche auf unserem Globus, die eben unterhalb des Meeresniveaus liegen z.B. das "Tote Meer" oder das "Death Valley" ...
... und auch für diese Standorte wird bezogen auf die Altitude ein Referenzwert in der Exif-Info gespeichert ...
... dazu heißt es bei www.exiv2.org ...
Key : GPSInfo Exif.GPSInfo.GPSAltitudeRef
Type : Byte
Tag description :
Indicates the altitude used as the reference altitude. If the reference is sea level and the altitude is above sea level, 0 is given. If the altitude is below sea level, a value of 1 is given and the altitude is indicated as an absolute value in the GSPAltitude tag. The reference unit is meters. Note that this tag is BYTE type, unlike other reference tags.
... und so hatte ich zunächst entsprechend der LatitudeRef bzw. LongitudeRef den folgenden Code in meiner exif.php verwendet ...
case "GPSAltitudeRef":
if($val==1) $val = "- (unter Meeresspiegel)";
if($val==0) $val = "+ (über Meeresspiegel)";
break;
... doch diese Lösung bringt nicht das gewünschte Ergebniss, da ich folgendes leichtfertig überlesen hatte ...
Note that this tag is BYTE type, unlike other reference tags.
... und wollte man sich den GPSAltitudeRef-Wert in den Exif-Infos nur mal anzeigen lassen und verwendet einfach folgendes ...
case "GPSAltitudeRef":
$val = $val;
break;
... so wird nur bei den negativen GPSAltitudeRef-Werten folgendes ausgegeben ...
... das Problem ist also ...
Note that this tag is BYTE type.
... ich denke, das Problem ist umfassend beschrieben ...
Frage also : Hat jemand für mich Lösungsvorschläge bzw. -ansätze dazu ?
-
Hi!
na sicher gibt es eine lösung:
für die neue exif version:
($key == "GPSAltitudeRef") {
$GPSAltitudeRef = bin2hex($exif_info[0]);
if($GPSAltitudeRef == 00) {$GPSAltitudeRef = "über Meeresspiegel";}
if($GPSAltitudeRef == 01) {$GPSAltitudeRef = "unter Meeresspiegel";}
$exif_array[$exif_match[$key]] = ($GPSAltitudeRef);
}
mfg Andi
-
hallo Andi ...
... danke für deine Antwort ...
... "bin2hex" ist der richtige Ansatz ...
... ich verwennde nun ...
case "GPSAltitudeRef":
$val = bin2hex($val);
if($val == 0) $val = "+ (über Meeresspiegel N.N.)";
if($val == 1) $val = "- (unter Meeresspiegel N.N.)";
break;
... nochmals ... danke ... :wink:
-
kein problem :D
für solche sachen bin ich immer zu haben.
mfg Andi
-
... bis zum heutigen Tag war damit die Welt auch noch in Ordnung, da ich nur GPS-Bilder oberhalb des Meeresniveaus auf meiner Seite hatte ...
... als normaler Mitteleuropäer denkt man, so glaube ich zumindest, auch nicht anders bzw. weiter ...
... doch gibt es auch Landstriche auf unserem Globus, die eben unterhalb des Meeresniveaus liegen z.B. das "Tote Meer" oder das "Death Valley" ...
... und eigentlich braucht man gar nicht so weit in der Welt herumzuschauen, um solchen Fall zu finden ...
... hier die tiefstgelegene begehbare Stelle Deutschlands mit 3,54m unter N.N. ... bei Wikipedia (http://de.wikipedia.org/wiki/Neuendorf-Sachsenbande) ...
... ;) ...
-
jetzt hat mich das auch interessiert.
tiefster punkt in österreich:
Hedwighof (Gemeinde Apetlon – Burgenland) 114 m :mrgreen:
lg Andi
-
Hallo,
wie kann ich am besten dieses ADDON http://www.4homepages.de/forum/index.php?topic=20450.0 in deinen Mod einbauen?
Ich lasse die EXIF Daten zwar über Deinen MOD auslesen, starte das aber über eine seperate Datei.
LG
ingo
-
Hi!
lass mir mal ein bild von dir zukommen, wo die linsen info darin enthalten sind.
mfg Andi
-
Call to undefined function exif_read_data() вот выдает при всех включеных модулях PHP, проблема хостинга?
-
@Kaliha
... only as a hint and for information ...
... PHP and function exif_read_data ...
... http://www.4homepages.de/forum/index.php?topic=18352.msg100155#msg100155 ...