问题标签 [wideimage]

For questions regarding programming in ECMAScript (JavaScript/JS) and its various dialects/implementations (excluding ActionScript). Note JavaScript is NOT the same as Java! Please include all relevant tags on your question; e.g., [node.js], [jquery], [json], [reactjs], [angular], [ember.js], [vue.js], [typescript], [svelte], etc.

0 投票
1 回答
93 浏览

php - File_exists() is returning false when it should return true, what can be causing this?

I edited the entire question to better represent the answer.

I had a for loop which would access and edit image files. Within the loop a file_exists() check was made. If the image file did not exist a blank one would be created.

What was happening was that even after the file was created, the file_exists() would continue returning false and creating new blank files (overwriting the previous operations).

This happens because file_exists() and some other file functions caches the result. To prevent this, use clearstatcache(); before using these functions if you expect the result to have changed and are checking the same file!

0 投票
0 回答
256 浏览

php - 在 PHP 中从许多小图像中创建一个大图像而不会耗尽内存

我正在尝试使用 WideImage 库从 PHP 中的许多小图像中创建一个非常大的图像。

如果图像变得太大,服务器显然会耗尽内存。

无论如何,是否可以通过批量执行此过程或直接写入磁盘来解决此问题?

代码看起来像这样:

谢谢!

0 投票
0 回答
62 浏览

php - WideImage - 如果对原始变量调用破坏方法,则加载的图像不会存储在另一个变量中

如果图像的宽度和高度小于 400 像素,则不要调整大小并将 $original 保存在 $resized 中。但是如果我调用$original->destroy(),存储的数据$resized也会得到null。如何销毁原件并将其副本保存在$resized变量中?

0 投票
3 回答
1354 浏览

php - 当文件大于 2 MB 时,php 调整大小功能不起作用

我正在使用以下功能上传图像文件并调整大小。

我非常适合小于 2 MB 的文件。但是当我上传大于 2 MB 的图像时,它不起作用。我转储 $image 对象创建它什么都不返回。

图像正在上传完美上传到服务器,但没有调整大小。请提出解决方案。

我正在使用这个图片库http://wideimage.sourceforge.net/

php.ini设置是

编辑:图像完美上传到服务器问题仅在文件大小大于 2 MB 时出现调整大小。

当文件大小小于 2MB 时var_dump($image)输出

而当大于 2MB 时,它什么也不返回

0 投票
0 回答
85 浏览

php - 检查以确保图像已使用 PHP 保存

我正在使用库 WideImage 将上传的图像调整为两个单独的大小,然后将图像保存在两个单独的目录中。问题是较小的图像并不总是保存。这是我的尝试:

这总是给我一个错误。我的假设是保存图像需要一些时间。所以我的问题是如何确保所有步骤都已成功完成?

0 投票
1 回答
1094 浏览

php - imagerotate 改变原始图像的颜色

使用 PHP 旋转图像时,我遇到了一个非常奇怪的行为。原始图像在旋转过程中被更改。例如,这里是并排的图像。很难看到,但如果仔细观察,刀周围的白色区域正在从#FFFFFF 更改为#FDFDFD。

在此处输入图像描述

我正在使用未指定选项的 imagerotate,但是,如果我尝试使用黑色背景颜色进行相同操作,我会得到一个带有黑色“填充”的旋转图像,但图像的白色部分仍然从 #FFFFFF 更改为 #FDFDFD . 我很困惑。这几乎就像 PHP 正在“四舍五入”颜色。

在此处输入图像描述

原图:http: //i.imgur.com/iYwvxAE.jpg

旋转图像:http: //i.imgur.com/0lXXuO6.jpg

编辑:

这是我的代码

0 投票
0 回答
125 浏览

php - WideImage 输出为奇怪的字符而不是图像

我正在尝试使用 WideImage 将裁剪后的图像显示为缩略图。

我用一组文件名作为参数($images)创建了一个函数,在其中生成了我的html

目前,我得到的只是

����JFIF``����ui$�J�$��]5�����j4���%�o�WEʴ���^[7��|��6�d�� P$g�bx�e��wh����N�� c��rp=Oz��h�F�Z��"��u8q�oN��la_28�g�����1� ��2G��1^Uy�EJ��'��|��9F[����Vn��2m�j�i��ַ差,4�� �? ����2zp3�P[|� ��>����1��8$u��+cQ��:x����-�II^r1��{U�+O��T�x��*b��3�� ��zv�m �)b�U��j�+'B�`m������a����T��r��Tq�1�*���� �{D_s �!AbG;v��������/i5��u���]�����M�]�]���#$Z���74"+ar]�-�', �B���J��W�}KY�/7H#��7�3-n�=����v�Ps�3�C~��N��h��j�q��6 ����- 等等

这些奇怪的数字是什么原因?

0 投票
1 回答
395 浏览

php - 使用 WideImage 在上传的图像上写入文本

我正在努力在基于 PHP 的项目上实现 WideImage 插件。

现在,我们可以上传图片(上传到基于会话 ID 的临时文件夹),但图片上没有文字。我在他们的网站上根据这个例子工作(减去阴影效果),但它似乎没有做任何事情。当我转到目标文件夹并查看上传的图像时,没有任何变化。

这是代码片段;有什么突出的错误吗?我最近添加了这setFont条线,但这似乎没有什么不同。

当我使用echo $userImagePath时,它确实给了我一个工作文件路径。

我也尝试过使用该fileFromUpload选项,但即使我从 HTML 表单中给它提供了文件字段的名称,它也不会将其识别为上传。

0 投票
0 回答
745 浏览

php - WideImage only working for some Images

WideImage is only working for some images. I can't figure out why, because the images are same filetype and same dimensions.

Here is my code

Function call

I'm receiving the following errror:

EDIT: This error is only occuring when i resend the data with firebug. At first there is no error shown.

Thumb Creation StartedEXCEPTION: exception 'WideImage_InvalidImageSourceException' with message 'File '/kunden/homepages/33/d582216481/htdocs/uploads/downloads/image .png' appears to be an invalid image source.' in /homepages/33/d582216481/htdocs/includes /WideImage/WideImage.php:226 Stack trace:

0 /homepages/33/d582216481/htdocs/includes/phpThumb.php(12):

WideImage::loadFromFile(' /kunden/homepag...')

1 /homepages/33/d582216481/htdocs/includes/addDownload.php(60):

make_thumb('/kunden/homepag ...', '/kunden/homepag...', 100)

2 {main}Thumb Creation Started

Can somebody explain, why it is working for some images, and for some not??

?>

Not working working

0 投票
1 回答
502 浏览

php - WideImage - 具有透明背景的画布

我们正在使用内置 WideImage 的 CMS,并且无法更改这一点,但是我们遇到了需要生成 300x300 图像的情况。

然而,以 jpg 和 png 格式以大约 100x100 上传的图像具有各种透明度。

我正在尝试创建一个 300x300 的画布,并将 100x100 的图像放在其中 - 但是我希望画布保持透明,并将图像放在顶部以保持其透明度。

我有

然而,这显然只是在画布上添加了一个白色背景,我无法从他们的文档中弄清楚如何使其透明。

谢谢