Greetings ... I'm changing the JPG from the directory on the fly. Pictures are randomly horizontal or vertical in nature My script (included below) works as expected - except in a specific case. This will be the case when I transfer photos from the memory card to the final directory, from which thumbs are made. In this situation - my vertical photo produces horizontal thumb.
If I process a folder of images on which the process has been processed, whether its size has changed or not, this problem does not occur. On the memory card the vertical photos are rotated on the camera and this is proof from the fact that on my local drive, Vertical Preview Vertical Preview. However, if I run unwanted files through the thumbnail script, then it rotates clockwise 90 degrees clockwise!
Is there any idea about a smart person? :)
In addition to that I hit the idea of placing a 'rotate' button in my interface, but I can not get the php function rotateimage () to work samples are sim ... no error No, but I get a mile of symbols and lessons in the browser
thanks.
function vs thumb (images for $ path, $ paths, $ thumbbite) {// open directory $ dir = opendir ($ pathToImages); // loop through it, looking for any / all JPG files: while (wrong! == ($ fname = readdir ($ dir))) // path path for $ info = pathinfo ($ pathToImages. $ Fname); // Only continue if it is a JPEG image (stroller ($ info ['extension']) == 'jpg') {Creating thumbnails for resonant "{$ fname}"
"; // load image and image size $ img = imagecreatefromjpeg (get "{$ pathToImages} {$ fname}"); $ Width = imagesx ($ img); $ Height = images ($ IMG); // Calculate thumbnail size $ new_width = $ thumbWidth; $ New_height = Floor ($ height * ($ thumb width / $ width)); // $ tmp_img = imagecreatetruecolor ($ new_width, $ new_height) to create a new tempopary image; // Copy and convert old image to new image / mapped image ($ tmp_img, $ img, 0, 0, 0, 0, $ new_width, $ new_height, $ width, $ height); Imagecopyresampled ($ tmp_img, $ img, 0, 0, 0, 0, $ new_width, $ new_height, $ width, $ height); // Save the thumbnail to a file imagejpeg ($ tmp_img, "{$ pathTohhmbs} {$ fname}"); }} // close the directory close ($ dir); }
Is it possible that you are going to your function rather than the height of your Width in initial 3 variables? It can cause this problem. We do not have a piece of code that passes these variables, then you want to put it above
Comments
Post a Comment