Jump to content

Recommended Posts

I'm trying to get OpenPhotoVR working on a local server.

 

I've installed Apache and PHP.

 

Source (files for the web site) can be found here:

http://openphotovr.org

 

When I try to 'upload' an image to the project, I get the error:

 

Warning: unlink(C:\WINDOWS\TEMP\TOf1AF.tmp.jpg) [function.unlink]: No such file or directory in C:\Program Files\Apache Software Foundation\Apache2.2\htdocs\add_image.php on line 55

 

Warning: unlink(C:\WINDOWS\TEMP\TOf1B0.tmp.jpg) [function.unlink]: No such file or directory in C:\Program Files\Apache Software Foundation\Apache2.2\htdocs\add_image.php on line 55

 

Warning: Cannot modify header information – headers already sent by (output started at C:\Program Files\Apache Software Foundation\Apache2.2\htdocs\add_image.php:55) in C:\Program Files\Apache Software Foundation\Apache2.2\htdocs\add_image.php on line 59

 

Can anyone help me with this?

 

Thanks in advance!

Link to comment
https://forums.phpfreaks.com/topic/113417-openphotovr-php-error/
Share on other sites

Is line 55 of add_image.php part of the code you have written or is it part of the OpenPhotoVR script? If it is part of your code, you will need to post add_image.php to get any specific help with it.

 

The uploaded temporary file name does not contain an ending .jpg that is being shown in the error message. This means that the code has incorrectly formed a file name. Also, there is no need to unlink/delete the temporary uploaded file, it is automatically deleted by php when the script ends.

add_image.php is part of the source code for OpenPhotoVR. The contents of it is below:

 

<?php

$tmp_name = "";

 

$url = $_REQUEST['url'];

if ($url && preg_match('/^http:\/\//', $url))

{

$tmp_name = tempnam("./data/", "tmp");

copy($url, $tmp_name);

} else {

$tmp_name = $_FILES['userfile']['tmp_name'];

}

 

if (!$info = getimagesize($tmp_name) or $info[2] != IMAGETYPE_JPEG)

{

exit;

}

$width = (int)$info[0];

$height = (int)$info[1];

 

$id = "";

$chars = "abchefghjkmnpqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789";

for ($i = 0; $i < 8; $i++)

$id .= substr($chars, rand() % strlen($chars), 1);

 

mkdir("data/$id");

 

$fh = fopen("./data/$id/nav.js", "w");

$info = array("id" => $id, "width" => $width, "height" => $height, "links" => array());

fwrite($fh, "nav(" . json_encode($info) . ");");

fclose($fh);

 

$levels = 1;

$tw = $width;

$th = $height;

while (($tw > 256) || ($th > 256))

{

$tw = ceil($tw/2);

$th = ceil($th/2);

$levels += 1;

}

 

$to_unlink = Array();

while (true)

{

array_push($to_unlink, $tmp_name);

`convert -crop 256x256 $tmp_name ./data/$id/$levels-%d.jpg`;

if ($levels == 1)

break;

$levels -= 1;

$new_tmp_name = tempnam("./temp", $id) . ".jpg";

`convert -resize 50%x50% $tmp_name $new_tmp_name`;

$tmp_name = $new_tmp_name;

}

foreach ($to_unlink as $name)

unlink($name);                                                                                          <----LINE 55

 

`convert -resize 50%x50% ./data/$id/1-0.jpg ./data/$id/thumbnail.jpg`;

 

header("Location: ./?edit=true&id=$id");

?>

  • 1 month later...

Microsoft has released Photosynth so it can be used by anyone.

-Sign up for a Live account

-Download the Photosynth client

-Create a Photosynth account (linked to you Live account)

-Add photos

The client does everything for you (putting pics in a 3d space) then uploads it to the Photosynth site so other people can see it and search for it (you add tags to your project).

I would too, I'd like to have the functionality locally, but PhotoSynth works for me because it does image placement automatically (which OpenPhotoVR doesn't).

 

If anyone can work out how to run OpenPhotoVR locally, I still want to know...

If anyone can work out how to run PhotoSynth locally :P ...

This thread is more than a year old. Please don't revive it unless you have something important to add.

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.