I'm working with images from a Kodak 2MP camera.
It looks like the function will only create a resource if I give it
horiznotal pictures from this camera....if I give it vertical (height larger
than width) images, it fails to create a resource.
What the hell is it doing? 4 2232
"jn" <js******@cfl.rr.com> wrote in message
news:Ak********************@twister.tampabay.rr.co m... I'm working with images from a Kodak 2MP camera.
It looks like the function will only create a resource if I give it horiznotal pictures from this camera....if I give it vertical (height
larger than width) images, it fails to create a resource.
What the hell is it doing?
It works on all the images on my Windows machine, but only works on
horizontal ones when it runs on the Linux server.
Here's the function:
function resize ($filename, $destination, $size, $quality) {
$origImage = imagecreatefromjpeg($filename);
$origWidth = imagesx($origImage);
$origHeight = imagesy($origImage);
$factor = $origHeight/$origWidth;
$newWidth = $size;
$newHeight = $size * $factor;
$newImage = imagecreatetruecolor($newWidth, $newHeight);
imagecopyresampled($newImage, $origImage, 0, 0, 0, 0, $newWidth,
$newHeight, $origWidth, $origHeight);
imagejpeg($newImage, $destination);
return $newHeight;
}
"jn" <js******@cfl.rr.com> wrote in message
news:yx********************@twister.tampabay.rr.co m... "jn" <js******@cfl.rr.com> wrote in message news:Ak********************@twister.tampabay.rr.co m... I'm working with images from a Kodak 2MP camera.
It looks like the function will only create a resource if I give it horiznotal pictures from this camera....if I give it vertical (height larger than width) images, it fails to create a resource.
What the hell is it doing?
It works on all the images on my Windows machine, but only works on horizontal ones when it runs on the Linux server.
Here's the function:
function resize ($filename, $destination, $size, $quality) { $origImage = imagecreatefromjpeg($filename); $origWidth = imagesx($origImage); $origHeight = imagesy($origImage); $factor = $origHeight/$origWidth; $newWidth = $size; $newHeight = $size * $factor; $newImage = imagecreatetruecolor($newWidth, $newHeight); imagecopyresampled($newImage, $origImage, 0, 0, 0, 0, $newWidth, $newHeight, $origWidth, $origHeight); imagejpeg($newImage, $destination); return $newHeight; }
PHP is telling me that they aren't valid JPEGs...that's the problem. :(
jn wrote: "jn" <js******@cfl.rr.com> wrote in message news:yx********************@twister.tampabay.rr.co m...
"jn" <js******@cfl.rr.com> wrote in message news:Ak********************@twister.tampabay.rr. com...
I'm working with images from a Kodak 2MP camera.
It looks like the function will only create a resource if I give it horiznotal pictures from this camera....if I give it vertical (height
larger
than width) images, it fails to create a resource.
What the hell is it doing?
It works on all the images on my Windows machine, but only works on horizontal ones when it runs on the Linux server.
Here's the function:
function resize ($filename, $destination, $size, $quality) { $origImage = imagecreatefromjpeg($filename); $origWidth = imagesx($origImage); $origHeight = imagesy($origImage); $factor = $origHeight/$origWidth; $newWidth = $size; $newHeight = $size * $factor; $newImage = imagecreatetruecolor($newWidth, $newHeight); imagecopyresampled($newImage, $origImage, 0, 0, 0, 0, $newWidth, $newHeight, $origWidth, $origHeight); imagejpeg($newImage, $destination); return $newHeight; }
PHP is telling me that they aren't valid JPEGs...that's the problem. :(
The reason why PHP is telling you that they are not valid JPEGs I
believe has to do with thumbnails - I believe (perhaps someone in this
newsgroup will know otherwise) that jpegs can contain a small thumbnail
in the same file as the full-sized image. I think its a standard... and
I believe some digital cameras break this standard in order to create
smaller file types... I have a Sony Mavica camera that creates images on
to a floppy diskette that I bought in 19977 and it wworks fine so I know
not all camera's will give you the problem.
Since I have yet to encounter the problem, I've not been able to test a
work around - but one idea I had was to resave the image using the
gd-library and then see if I could manipulate it...
I don't know if it would owrk... in addition... I think I'll recognise
the problem if I encounter problems with width like you had.
I hope the above is some help...
laters
randelld
"Randell D." <pl*******************@news.group.com> wrote in message
news:0sYtb.406842$6C4.166786@pd7tw1no... jn wrote: "jn" <js******@cfl.rr.com> wrote in message news:yx********************@twister.tampabay.rr.co m...
"jn" <js******@cfl.rr.com> wrote in message news:Ak********************@twister.tampabay.rr. com...
I'm working with images from a Kodak 2MP camera.
It looks like the function will only create a resource if I give it horiznotal pictures from this camera....if I give it vertical (height
larger
than width) images, it fails to create a resource.
What the hell is it doing?
It works on all the images on my Windows machine, but only works on horizontal ones when it runs on the Linux server.
Here's the function:
function resize ($filename, $destination, $size, $quality) { $origImage = imagecreatefromjpeg($filename); $origWidth = imagesx($origImage); $origHeight = imagesy($origImage); $factor = $origHeight/$origWidth; $newWidth = $size; $newHeight = $size * $factor; $newImage = imagecreatetruecolor($newWidth, $newHeight); imagecopyresampled($newImage, $origImage, 0, 0, 0, 0, $newWidth, $newHeight, $origWidth, $origHeight); imagejpeg($newImage, $destination); return $newHeight; }
PHP is telling me that they aren't valid JPEGs...that's the problem. :(
The reason why PHP is telling you that they are not valid JPEGs I believe has to do with thumbnails - I believe (perhaps someone in this newsgroup will know otherwise) that jpegs can contain a small thumbnail in the same file as the full-sized image. I think its a standard... and I believe some digital cameras break this standard in order to create smaller file types... I have a Sony Mavica camera that creates images on to a floppy diskette that I bought in 19977 and it wworks fine so I know not all camera's will give you the problem.
Since I have yet to encounter the problem, I've not been able to test a work around - but one idea I had was to resave the image using the gd-library and then see if I could manipulate it...
I don't know if it would owrk... in addition... I think I'll recognise the problem if I encounter problems with width like you had.
I hope the above is some help...
laters randelld
I tried resaving the image in Photoshop, and it still wouldn't work. And I'm
not sure how I would get GD to resave it without using ImageCreateFromJPEG()
anyway.
I'm now trying to get ImageMagick to work on my server so I don't have to
worry about GD. Thanks for the help though. This thread has been closed and replies have been disabled. Please start a new discussion. Similar topics |
by: jn |
last post by:
This is the weirdest thing I've come across in a while.
I'm trying to resize an image. If I give it a small image ( < 100K) it will
resize. If I give it a larger image, it gives me the IE "Action...
|
by: Simon Stewart |
last post by:
Has anyone else experience of imagecreatefromjpeg failing with an error
message about memory even though the size of the image being uploaded is
nothing like the space available to the script?
...
|
by: bernie |
last post by:
Howdy,
I have an image upload and resize script that I have used on a number of
servers with no issues. I have now use it in a new app that I uploaded
to a new server. I worked fine on my dev...
|
by: RugbyTravis |
last post by:
I want to have a list that is horizontal and each <li> has different
images. I also want them to change on hover. I want the words to be
below the images as well. Anyone of you styles gurus have...
|
by: Dan V. |
last post by:
I have tried a number of things including preloading, but the background
image (water tile in header) in IE 6 will not display where other browsers
will....
| |
by: J-T |
last post by:
My website is fine when it is viewed in 1280 by 1024 pixel ,but in smaller
resulotions there is a horizontal scrollbar down the page.How can I set it
to be viewed the same for all resulotions?
...
|
by: Areric |
last post by:
Ok all. I have a series of images stored in a db. Im trying to work on
a script that will let me scale them based on user input. Ive hit a bit
of a roadblock on this line.
$orig =...
|
by: tim.landgraf |
last post by:
hi there,
i am experiencing a strange problem. i am iterating through a given
directory, selecting only jpg - images that are then resized and
inserted into a database. everything works, but if...
|
by: ryrocks |
last post by:
Hello everyone!
Im having a little trouble with my horizontal scrolling set of video thumbnails.
I've got 6 video thumbnails that the user scrolls through horizontally, I've got this working...
|
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: 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...
|
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...
|
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,...
|
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...
|
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...
|
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...
| |
by: bsmnconsultancy |
last post by:
In today's digital era, a well-designed website is crucial for businesses looking to succeed. Whether you're a small business owner or a large corporation in Toronto, having a strong online presence...
| |