473,666 Members | 2,528 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

how to create a gallery without using the EXIF function?

I have tried to use a php code (found it online) to create a gallery
but I am wondering if thereare any other PHP options besides using
EXIF.
The reason is that the images I am using for the gallery are not taken
using a camera and therefore don't have the EXIF data.
And since the images will be uploaded by a third party who is not very
computer savvy the option of having them edit the images to add the
EXIF data is not a very feasible one so I am looking for other options
in PHP.
Please bear with me.....I am a novice PHP programmer (more like a
newbie) and although I do understand the basics of programming and do
some programming in ASP, PHP looks very foreign to me right now....
I am trying my best to learn from books but so far I haven't learned
enough to implement this on my own so I am asking for some help from
the experts.
I need to create a code that will pull out 4 images from a folder that
will have the same username as the user's login.
After login the user is taken to a page that will contain the 4 images
in the folder arranged in a table or div.
The issue right now is finding something that can work side by side
with Joomla.....unle ss I use a page not in Joomla at all....which
would make the programming much easier maybe?
WHat do you think?
Thank you in advance for any help finding an answer.

FayeC
Nov 22 '05 #1
4 1806
Message-ID: <i0************ *************** *****@4ax.com> from FayeC
contained the following:
I need to create a code that will pull out 4 images from a folder that
will have the same username as the user's login.
After login the user is taken to a page that will contain the 4 images
in the folder arranged in a table or div.

I started work on something similar last night.
http://www.ckdog.co.uk/jladder/files.php
It crudely shows .jpgs in a directory as thumbnails (simple browser
resizing). I've still got quite a bit to do, but it may be useful.
<HTML>
<HEAD>
<TITLE>File management</TITLE>
<META HTTP-EQUIV="Content-Type" CONTENT="text/html; charset=iso-8859-1">
</HEAD>
<BODY BGCOLOR="#FFFFF F" TEXT="#000000">
<table align="center" border="1" cellspacing="0" cellpadding="2" >
<?php

//$dir = $path."";
$path=$_SERVER['PATH_TRANSLATE D'];
//print "$path<br>" ;
$i= strlen($path);
//print"$i<br>";
do{$i--;}
while(strpos($p ath,"/",$i)===fal se);
//print"$i<br>";
//print substr($path,0, $i);
$path=substr($p ath,0,$i+1);
$dir=$path;

// Open a known directory, and proceed to read its contents
//if (is_dir($dir)) {
$width=100;
if ($dh = opendir($dir)) {
while (($file = readdir($dh)) !== false) {
//print $dir . $file;
if($file!="." && $file!=".." &&
strtolower(subs tr($file,-3))=="jpg"){

$size = getimagesize($f ile);

$height=($size[1]*$width)/$size[0];
echo "<tr><td><i mg src='$file'widt h='$width'
height='$height '></td><td><b> <a
href=\"$file\"> $file</a></b></td></tr>\n";
}
}
closedir($dh);
}
//}
?>
</table>
</form>
</BODY>
</HTML>

--
Geoff Berrow (put thecat out to email)
It's only Usenet, no one dies.
My opinions, not the committee's, mine.
Simple RFDs http://www.ckdog.co.uk/rfdmaker/
Nov 22 '05 #2
Why do you think you have to use exif in the first place?

Here is more sample code to get you started:
http://prdownloads.sourceforge.net/s...r.bz2?download

FayeC wrote:
I have tried to use a php code (found it online) to create a gallery
but I am wondering if thereare any other PHP options besides using
EXIF.
The reason is that the images I am using for the gallery are not taken
using a camera and therefore don't have the EXIF data.
And since the images will be uploaded by a third party who is not very
computer savvy the option of having them edit the images to add the
EXIF data is not a very feasible one so I am looking for other options
in PHP.
Please bear with me.....I am a novice PHP programmer (more like a
newbie) and although I do understand the basics of programming and do
some programming in ASP, PHP looks very foreign to me right now....
I am trying my best to learn from books but so far I haven't learned
enough to implement this on my own so I am asking for some help from
the experts.
I need to create a code that will pull out 4 images from a folder that
will have the same username as the user's login.
After login the user is taken to a page that will contain the 4 images
in the folder arranged in a table or div.
The issue right now is finding something that can work side by side
with Joomla.....unle ss I use a page not in Joomla at all....which
would make the programming much easier maybe?
WHat do you think?
Thank you in advance for any help finding an answer.

FayeC


Nov 22 '05 #3
I tried it and just modified the path as it is adding the username to
the path but I then get several errors
regarding not opening the stream and also a division by 0:
<?php
$username = $_POST['username'];
//$dir = $path."";
$path = "images/" . $username;
//print "$path<br>" ;
$i= strlen($path);
//print"$i<br>";
do{$i--;}
while(strpos($p ath,"/",$i)===fal se);
//print"$i<br>";
//print substr($path,0, $i);
$path=substr($p ath,0,$i+1);
$dir=$path;

// Open a known directory, and proceed to read its contents
//if (is_dir($dir)) {
$width=100;
if ($dh = opendir($dir)) {
while (($file = readdir($dh)) !== false) {
//print $dir . $file;
if($file!="." && $file!=".." &&
strtolower(subs tr($file,-3))=="jpg"){

$size = getimagesize($f ile);

$height=($size[1]*$width)/$size[0];
echo "<tr><td><i mg src='$file'widt h='$width'
height='$height '></td><td><b> <a
href=\"$file\"> $file</a></b></td></tr>\n";
}
}
closedir($dh);
}
//}
?>

Gets:
Warning: getimagesize(jo omla_logo_black .jpg) [function.getima gesize]:
failed to open stream: No such file or directory in
f:\apache_root\ ucbaby\on\galle ry.php on line 71

Warning: Division by zero in f:\apache_root\ ucbaby\on\galle ry.php on
line 73

FayeC

On Tue, 22 Nov 2005 07:04:13 +0000, Geoff Berrow
<bl******@ckdog .co.uk> wrote:
Message-ID: <i0************ *************** *****@4ax.com> from FayeC
contained the following:
I need to create a code that will pull out 4 images from a folder that
will have the same username as the user's login.
After login the user is taken to a page that will contain the 4 images
in the folder arranged in a table or div.

I started work on something similar last night.
http://www.ckdog.co.uk/jladder/files.php
It crudely shows .jpgs in a directory as thumbnails (simple browser
resizing). I've still got quite a bit to do, but it may be useful.
<HTML>
<HEAD>
<TITLE>File management</TITLE>
<META HTTP-EQUIV="Content-Type" CONTENT="text/html; charset=iso-8859-1">
</HEAD>
<BODY BGCOLOR="#FFFFF F" TEXT="#000000">
<table align="center" border="1" cellspacing="0" cellpadding="2" >
<?php

//$dir = $path."";
$path=$_SERV ER['PATH_TRANSLATE D'];
//print "$path<br>" ;
$i= strlen($path);
//print"$i<br>";
do{$i--;}
while(strpos($ path,"/",$i)===fal se);
//print"$i<br>";
//print substr($path,0, $i);
$path=substr($ path,0,$i+1);
$dir=$path;

// Open a known directory, and proceed to read its contents
//if (is_dir($dir)) {
$width=100;
if ($dh = opendir($dir)) {
while (($file = readdir($dh)) !== false) {
//print $dir . $file;
if($file!="." && $file!=".." &&
strtolower(sub str($file,-3))=="jpg"){

$size = getimagesize($f ile);

$height=($size[1]*$width)/$size[0];
echo "<tr><td><i mg src='$file'widt h='$width'
height='$heigh t'></td><td><b> <a
href=\"$file\" >$file</a></b></td></tr>\n";
}
}
closedir($dh);
}
//}
?>
</table>
</form>
</BODY>
</HTML>

Nov 25 '05 #4
Message-ID: <1a************ *************** *****@4ax.com> from FayeC
contained the following:
I tried it and just modified the path as it is adding the username to
the path but I then get several errors
regarding not opening the stream and also a division by 0:


Yeah, the path has to be the full path to the directory. But I'm doing
it slightly differently now.

I've replaced:

//$dir = $path."";
$path=$_SERVER['PATH_TRANSLATE D'];
//print "$path<br>" ;
$i= strlen($path);
//print"$i<br>";
do{$i--;}
while(strpos($p ath,"/",$i)===fal se);
//print"$i<br>";
//print substr($path,0, $i);
$path=substr($p ath,0,$i+1);
$dir=$path;

with

$path=$_SERVER['SCRIPT_FILENAM E'];
$dir=dirname($p ath);

This will give you the path to the current directory. You'll have to
append any subdirectory info to that.

--
Geoff Berrow (put thecat out to email)
It's only Usenet, no one dies.
My opinions, not the committee's, mine.
Simple RFDs http://www.ckdog.co.uk/rfdmaker/
Nov 25 '05 #5

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

1
3644
by: Phil Powell | last post by:
PHP 4.3.2 with --enable-exif I have the following class: <?php class ThumbGenerator extends MethodGeneratorForActionPerformer { function ThumbGenerator() { // CONSTRUCTOR
54
7210
by: Max Quordlepleen | last post by:
Apologies for the crossposting, I wasn't sure which of these groups to ask this in. I have been lurking in these groups for a week or so, trying to glean what I need to design a simple, clean set of pages that get the w3c tick for XHTML 1.0 Strict, and CSS2. So far, I have succeeded, thanks to the great information in these groups. Now, however, I'm having trouble. A few days ago, I read a thread that dealt with this issue of...
8
20354
by: barb | last post by:
So that the world at large benefits from our efforts, here is one fully documented way to use Windows Irfanview freeware to create thumbnail web galleries (http://www.irfanview.com). STEP 1: Start with original thumbnails & two empty sub directories STEP 2: Create smaller versions of the originals for one sub directory STEP 3: Create thumbnail version of the originals the other sub directory STEP 4: Create an index.html pointing to the...
1
4946
by: Alfonso Acosta | last post by:
Hi all, exif_read_data() doesn't support URLs (http://php.net/manual/en/function.exif-read-data.php ) but I would like to do that with the minimum traffic and overhead possible. A naive solution would be downloading the whole target file locally and then call exif_read_data() but that means a lot of overhead traffic
14
5222
by: Frank | last post by:
I see that ImageFormat includes exif. But I can't find out if I've System.Drawing.Image.FromStream or something like it can read and/or write that format.
11
2090
by: shror | last post by:
hi every body I need help please i have designed an image gallery of about 20 pictures and they are shown in thumb nail views and for viewing the largeer version of the images i have added a radio button and a push button, so that the user choose the picture using the radio button and click on the push button to open the larger version picture in another window, but my problem is that i know how to pass the selection to the second page...
0
4192
by: numbnutz | last post by:
Hi, I am currently working on an XML Gallery for my girlfriend's brother who is a photographer. I have created a flash front end template and am using an XML database to load the images and accompanying captions. The gallery has more than one image and the user can navigate the gallery by clicking forward and backward buttons to take then through the images: var galleryXML = new XML(); galleryXML.ignoreWhite = true;...
2
2309
anfetienne
by: anfetienne | last post by:
hi, i've got a flash gallery which i've paid for. Im using swf object to import vars to the gallery....the var being imported is a html address to specify the location of files and folders. The problem is that the gallery detects the thumbnails and loads the 1st image but once i click on another image it wont load, i don't know why it it doing this and as it loads the thumbnails which are in the same location it shouldn't have a problem...
0
2298
nomad
by: nomad | last post by:
Hello Everyone. I founded an Flash and xml photo gallery. It works but I took it to another step What I want is to have six different galleries in one Flash file. I figure out how to do that but when I click on the the galleries I can see the pervious gallery files. The gallery works like this: When you open the gallery there are links on top of the page where you can go to other gallery; with gallery one which has small thumbnails on...
0
8440
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However, people are often confused as to whether an ONU can Work As a Router. In this blog post, we’ll explore What is ONU, What Is Router, ONU & Router’s main usage, and What is the difference between ONU and Router. Let’s take a closer look ! Part I. Meaning of...
0
8780
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven tapestry of website design and digital marketing. It's not merely about having a website; it's about crafting an immersive digital experience that captivates audiences and drives business growth. The Art of Business Website Design Your website is...
0
8636
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each protocol has its own unique characteristics and advantages, but as a user who is planning to build a smart home system, I am a bit confused by the choice of these technologies. I'm particularly interested in Zigbee because I've heard it does some...
1
6189
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new presenter, Adolph Dupré who will be discussing some powerful techniques for using class modules. He will explain when you may want to use classes instead of User Defined Types (UDT). For example, to manage the data in unbound forms. Adolph will...
0
5661
by: conductexam | last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and then checking html paragraph one by one. At the time of converting from word file to html my equations which are in the word document file was convert into image. Globals.ThisAddIn.Application.ActiveDocument.Select();...
0
4192
by: TSSRALBI | last post by:
Hello I'm a network technician in training and I need your help. I am currently learning how to create and manage the different types of VPNs and I have a question about LAN-to-LAN VPNs. The last exercise I practiced was to create a LAN-to-LAN VPN between two Pfsense firewalls, by using IPSEC protocols. I succeeded, with both firewalls in the same network. But I'm wondering if it's possible to do the same thing, with 2 Pfsense firewalls...
0
4358
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
1
2765
by: 6302768590 | last post by:
Hai team i want code for transfer the data from one system to another through IP address by using C# our system has to for every 5mins then we have to update the data what the data is updated we have to send another system
2
2005
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.