php allowed memory size exhausted on image upload rotation

I have a script that uploads images and rotates them depending on the orientation and I'm experiencing the problem that when an image that has EXIF tags is uploaded, I get an error saying: Allowed memory size of 33554432 bytes exhausted (tried to allocate 10368 bytes. And then the line it is referring to in the error log. I did notice that it's only happening with images that have E

PHP允许图像上传旋转耗尽内存大小

我有一个脚本可以上传图片并根据方向旋转它们,我遇到的问题是当上传带有EXIF标签的图片时,我收到一个错误消息: 允许的内存大小33554432字节耗尽(试图分配10368字节。 然后在错误日志中提到它所在的行。 我确实注意到它只发生在具有EXIF标签的图像上。 如果正常的图像,由Photoshop或上传的东西上传,它没有任何问题。 实际的图像方向代码如下所示: function correctImageOrientation($fullpath) { if (function_

PHP resize an image without saving a file

I have images that are displayed as thumbnails on my site. The size of thumbnails varies a lot. Ideally, I would not have to save a copy of each photo in each thumbnail's dimensions. Rather, I could specify in PHP the final dimensions, and have the image resized before it is sent from the server. I am not trying to resize a photo when it is being uploaded to the server. I am not able to

PHP在不保存文件的情况下调整图像大小

我的图片在我的网站上显示为缩略图。 缩略图的大小差别很大。 理想情况下,我不必在每个缩略图的尺寸中保存每张照片的副本。 相反,我可以在PHP中指定最终尺寸,并在从服务器发送图像之前调整图像大小。 我不想在照片上传到服务器时调整其大小。 由于每个缩略图的大小,我无法保存图像。 问题在于缩略图的大小因页面布局而异。 因此,如果我将图像保存为每个缩略图大小,我将节省大约20倍的照片数量。 我试图保存一个

Lossless image rotate PHP

I've been working on a system to rotate an uploaded image. The algorithm works as follows: 1) User uploads a jpeg. It gets saved as a PNG 2) Link to the temp png is returned to the user. 3) The user can click 90left,90right, or type in N degrees to rotate 4) The png is opened using $image = imagecreatefrompng("./fileHERE"); 5) The png is rotated using $imageRotated = imagero

无损图像旋转PHP

我一直在研究一个系统来旋转上传的图像。 该算法的工作原理如下: 1) User uploads a jpeg. It gets saved as a PNG 2) Link to the temp png is returned to the user. 3) The user can click 90left,90right, or type in N degrees to rotate 4) The png is opened using $image = imagecreatefrompng("./fileHERE"); 5) The png is rotated using $imageRotated = imagerotate($image,$degrees,0); 6) The

How to rotate image repetitively in php without increasing its file size

I am currently using imagerotate() available in php GD to let user rotate images. Whenever user rotates like 45 degree, 75 degree etc, background color is added to make image have rectangle shape. The more the number of time user rotates,the bigger the image size and the wider the background color area. $image = imagerotate($image,45, 0xFFFFFF); Is there anyway in php gd to rotate image with

如何在不增加文件大小的情况下在PHP中重复旋转图像

我目前使用php GD中的imagerotate()来让用户旋转图像。 每当用户像45度,75度等旋转时,添加背景色使图像具有矩形形状。 用户旋转的次数越多,图像尺寸越大,背景颜色区域越宽。 $image = imagerotate($image,45, 0xFFFFFF); 无论如何,在无需添加任何背景图像或没有增加文件图像的情况下,可以使用自由程度(例如:45度,75度,306度)旋转图像。 编辑:当图像尺寸越来越大,白色区域变得越来越宽时,出现此错误:“致命

PHP save image file

Possible Duplicate: Saving image from PHP URL using PHP Hi I have an image as a url link from the 3rd party web thumb site (IE http://images.websnapr.com/?size=size&key=Y64Q44QLt12u&url=http://google.com) What I would like to do is run a script that takes the image and saves it in a directory on my server using php. Can anyone point me in the right way to do this please? would I use

PHP保存图像文件

可能重复: 使用PHP从PHP URL保存图像 您好我有一个图像作为从第三方网络拇指网站(IE http://images.websnapr.com/?size=size&key=Y64Q44QLt12u&url=http://google.com)的URL链接我想要做的是运行一个脚本来获取镜像,并使用php将它保存在服务器上的一个目录中。 任何人都可以用正确的方式指出我这样做吗? 我会使用文件写入? 正如其他人所建议的那样,无需创建GD资源。 $input = 'http://images.websnapr.co

How do you center an image in a specified area, without resizing the image?

I want to center an image in an area, without resizing... I am using HTML. Example: I have an image <img src='img1.png' width='64' height='64'> - the image is actually 64x64. It displays perfectly. Now, I have another image <img src='img2.png' width='64' height='64'> however, the image is not as big as it should be, its 32x32 - wh

如何在指定区域对图像进行居中,而不调整图像大小?

我想在一个区域中居中放置图像,而无需调整大小...我正在使用HTML。 例: 我有一个图像<img src ='img1.png'width = '64'height = '64'> - 图像实际上是64x64。 它显示完美。 现在,我还有另一张图片,不过,图像并不像它应该的那么大,它的32x32-这里发生的是它调整图像的大小到64x64,并使它看起来像$%^&。 如何让图像更小,然后在'img'区域居中所需的宽度和高度,而无需调

Android not responding

I am attempting to apply some elements of responsive design to a site. My goal is to hide the right side based on screen width. I've been able to get the behavior to change on my desktop (when minimize the window) as well as my iphone. But, my andriod is still displaying the right side just like the full desktop site. I had the max-width set to 750px, but increased it to 1000 to try and

Android没有回应

我试图将一些响应式设计元素应用到网站。 我的目标是根据屏幕宽度隐藏右侧。 我已经能够在我的桌面上(当最小化窗口时)改变行为以及我的iphone。 但是,我的andriod仍然显示正确的一面,就像整个桌面网站一样。 我将最大宽度设置为750px,但将其增加到1000以尝试让andriod执行某些操作,但仍然不是运气。 我的CSS最初看起来像这样: #container { width: 980px; text-align: left; margin: 10px auto; font-family: Aria

search PHP

I need to do research in AD-PHP with LDAP, but every time I do not have success. I'm filtering by sAMAccountName. When I use a user with simple name ( Ex: printer) everything is ok but when the name is not simple ( Ex: paulo.neves) it does not work. Any ideas? $usuario = "paulo.neves"; $base_dn = "ou=Administradores, dc=tiisa, dc=com, dc=br"; $filter = "(&(objectClass=us

搜索PHP

我需要使用LDAP在AD-PHP中进行研究,但每次我都没有成功。 我通过sAMAccountName进行筛选。 当我使用简单名称的用户( 例如:打印机)时,一切正常,但名称不简单时( 例如: paulo.neves)不起作用。 有任何想法吗? $usuario = "paulo.neves"; $base_dn = "ou=Administradores, dc=tiisa, dc=com, dc=br"; $filter = "(&(objectClass=user)(objectCategory=person)(cn=*)(samaccountname=$usuario))";

"objectclass not equal to" is not working

I am working with LDAP Active Directory and trying to list all users. I have this filter which works perfect: (&(objectclass=user)(|(memberOf=...)(memberOf=...)...)(|(userprincipalname=...)(displayname=...))) Unfortunately, we have also a computer units and other devices present in AD with objectclass "user" so with previous filter I got all users, computers, devices, rooms, etc.

“objectclass不等于”不起作用

我正在使用LDAP Active Directory并尝试列出所有用户。 我有这个完美的过滤器: (&(objectclass=user)(|(memberOf=...)(memberOf=...)...)(|(userprincipalname=...)(displayname=...))) 不幸的是,我们还有一个计算机单元和其他设备出现在AD中,具有objectclass“user”,因此通过之前的过滤器,我获得了所有用户,计算机,设备,房间等。 这些计算机和设备也有一个objectclass“computer”,所以我需要使用objectclass!=

How do I extract files without folder structure using tar

I have a tar.gz-file with the following structure: folder1/img.gif folder2/img2.gif folder3/img3.gif I want to extract the image files without the folder hierarchy so the extracted result looks like: /img.gif /img2.gif /img3.gif I need to do this with a combination of Unix and PHP. Here is what I have so far, it works to extract them to the specified directory but keeps the folder hierarchy:

如何使用tar提取文件夹结构的文件

我有一个tar.gz文件,结构如下: folder1/img.gif folder2/img2.gif folder3/img3.gif 我想提取没有文件夹层次结构的图像文件,因此提取的结果如下所示: /img.gif /img2.gif /img3.gif 我需要结合使用Unix和PHP来做到这一点。 这是我到目前为止,它的作品将其提取到指定的目录,但保持文件夹层次结构: exec('gtar --keep-newer-files -xzf images.tgz -C /home/user/public_html/images/',$ret); 您可以使用tar的--stri