Need recomendation for script that would dynamicly create thumbnails from
pictures in certain directory, and automaticly genreate link to original
pictures...
Tuts are also welcom...
TNX.
------ www.podvodni-svijet.com
"Half-brother in blood,
full brother in heart will I be.
Thou shalt lead and I will follow.
May no new grief divide us."
Valar morghulis!
--
Remove all FAKEs when replying to mail ! 4 1458
look for some php photo-album software and review their source-code. I
worked it out by reading the php manual (image functions).
here's a function I wrote some time ago (for a photo album program of my
own). It tries to use a function called imageCopyResampled() but falls
back to imageCopyResized(). The newer function imageCopyResampled()
gives better quality but not all version of GD PHP modules have it.
You will have to modify this function as it was designed for my app. The
main param you are interested in is $intSize which represents the
maximum length of the longest side you want the thumbnail to be.
function createThumbnail($id,$idSrcImg,$intSize) {
$uriSrcDir = "../albums".$id."/";
$uriSrcImg = $uriSrcDir.$idSrcImg;
$uriThmImg = $uriSrcDir."_thumbs/".$idSrcImg;
$imgSrc=imagecreatefromjpeg($uriSrcImg);
$intSrcH = ImageSY($imgSrc);
$intSrcW = ImageSX($imgSrc);
if($intSrcH == $intSrcW) {
$intHeight = $intWidth = $intSize;
}
elseif($intSrcH > $intSrcW) {
$intHeight = $intSize;
$intWidth = ceil(($intSrcW/$intSrcH) * $intSize);
}
else {
$intWidth = $intSize;
$intHeight = ceil(($intSrcH/$intSrcW) * $intSize);
}
$imgThm=imagecreate($intWidth,$intHeight);
if(
!@imageCopyResampled(
$imgThm,
$imgSrc,
0,
0,
0,
0,
$intWidth,
$intHeight,
$intSrcW,
$intSrcH
)
) {
imageCopyResized(
$imgThm,
$imgSrc,
0,
0,
0,
0,
$intWidth,
$intHeight,
$intSrcW,
$intSrcH
);
}
re: revious example code:
forgot to include a closing brace in all the excitement...
Tnx. I will take a look at your code and refer to manual, im sure I'l manage
something..
Cheers....
------ www.podvodni-svijet.com
"Half-brother in blood,
full brother in heart will I be.
Thou shalt lead and I will follow.
May no new grief divide us."
Valar morghulis!
--
Remove all FAKEs when replying to mail !
Terence natipkase: re: revious example code: forgot to include a closing brace in all the excitement... http://www.php.net/image
but i found it easier to use ImageMagick's convert tool, called via an
exec() in my thumbnailing script.
..: DeVa :. wrote: Need recomendation for script that would dynamicly create thumbnails from pictures in certain directory, and automaticly genreate link to original pictures...
Tuts are also welcom...
TNX.
------ www.podvodni-svijet.com
"Half-brother in blood, full brother in heart will I be. Thou shalt lead and I will follow. May no new grief divide us."
Valar morghulis! -- Remove all FAKEs when replying to mail ! This thread has been closed and replies have been disabled. Please start a new discussion. Similar topics
by: Roel Wuyts |
last post by:
CALL FOR CONTRIBUTIONS
International Workshop on Revival of Dynamic Languages
http://pico.vub.ac.be/~wdmeuter/RDL04/index.html
(at OOPSLA2004, Vancouver, British Columbia, Canada, October...
|
by: Materialised |
last post by:
Hi Everyone,
I apologise if this is covered in the FAQ, I did look, but nothing
actually stood out to me as being relative to my subject.
I want to create a 2 dimensional array, a 'array of...
|
by: Stephen Gennard |
last post by:
Hello,
I having a problem dynamically invoking a static method that takes a
reference to a SByte*. If I do it directly it works just fine.
Anyone any ideas why?
I have include a example...
|
by: rangermccoy |
last post by:
Hello there,
What are the best php/c libraries for handling media including images,
video, and music?
I would like to manipulate media dfiles, including watermarking,
thumbnailing,...
|
by: serge |
last post by:
How can I run a single SP by asking multiple sales question either
by using the logical operator AND for all the questions; or using
the logical operator OR for all the questions. So it's always...
|
by: Pascal Costanza |
last post by:
Dynamic Languages Day @ Vrije Universiteit Brussel
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
Monday, February 13, 2006, VUB Campus Etterbeek
The VUB (Programming Technology Lab,...
|
by: philleep |
last post by:
Hi,
Someone told me that you can do auto thumbnailing in php. How?
cheer,
Philleep
|
by: bearophileHUGS |
last post by:
I often use Python to write small programs, in the range of 50-500
lines of code. For example to process some bioinformatics data,
perform some data munging, to apply a randomized optimization...
|
by: Charles Arthur |
last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
|
by: ryjfgjl |
last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
|
by: emmanuelkatto |
last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud.
Please let me know.
Thanks!
Emmanuel
|
by: BarryA |
last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
|
by: Sonnysonu |
last post by:
This is the data of csv file
1 2 3
1 2 3
1 2 3
1 2 3
2 3
2 3
3
the lengths should be different i have to store the data by column-wise with in the specific length.
suppose the i have to...
|
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,...
|
by: Oralloy |
last post by:
Hello folks,
I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>".
The problem is that using the GNU compilers,...
|
by: Hystou |
last post by:
Overview:
Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows...
|
by: agi2029 |
last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing,...
| |