Smart Image Processor PHP 2 Support Product Page

Solved

Smart Image Processor PHP 2/ Pure PHP Upload 2

Reported 09 Feb 2013 15:56:19
2
have this problem
09 Feb 2013 15:56:19 Jean Pierre Valls posted:
Hello,

I have a problem with the extension functionality Smart Image Processor PHP 2.

When I use Pure PHP Upload 2 and Smart Image Processor PHP 2 in a single page, the operation is correct, because it is a simple download.

When I add the server behavior Inserting a record, download and insertion are OK in the database, but resizing and inserting the text for the watermark is not Ok
I do not understand, why.
It is very important to me that it works.

Thank you for your help.

Excuse my English, I am a French user.

cordially
Jean Pierre Valls

Official Solution

Replied 05 Jan 2015 10:58:52
Hi all,
The issue is caused by DW sometimes not inserting the following piece of code, which is most probably caused by the fact the DW server behaviors are deprecated already.

if (isset($editFormAction)) {
  if (isset($_SERVER['QUERY_STRING'])) {
	  if (!preg_match("/GP_upload=true/i", $_SERVER['QUERY_STRING'])) {
  	  $editFormAction .= "&GP_upload=true";
		}
  } else {
    $editFormAction .= "?GP_upload=true";
  }
}


The proper order you should insert the extensions is:

1. Create your form with the file field.
2. Add the INSERT RECORD
3. Add Pure PHP Upload 3
4. Add Smart Image Processor PHP 2

Then look at your code. The generated code should be something like:

.....
$editFormAction = $_SERVER['PHP_SELF'];
if (isset($_SERVER['QUERY_STRING'])) {
  $editFormAction .= "?" . htmlentities($_SERVER['QUERY_STRING']);
}


if (!isset($mm_abort_edit) || !$mm_abort_edit) {
if ((isset($_POST["MM_insert"])) && ($_POST["MM_insert"] == ....


All you need to do is to add the code i mentioned above, after the

$editFormAction = $_SERVER['PHP_SELF'];
if (isset($_SERVER['QUERY_STRING'])) {
  $editFormAction .= "?" . htmlentities($_SERVER['QUERY_STRING']);
}


So the final code becomes:


.....
$editFormAction = $_SERVER['PHP_SELF'];
if (isset($_SERVER['QUERY_STRING'])) {
  $editFormAction .= "?" . htmlentities($_SERVER['QUERY_STRING']);
}

if (isset($editFormAction)) {
  if (isset($_SERVER['QUERY_STRING'])) {
	  if (!preg_match("/GP_upload=true/i", $_SERVER['QUERY_STRING'])) {
  	  $editFormAction .= "&GP_upload=true";
		}
  } else {
    $editFormAction .= "?GP_upload=true";
  }
}

if (!isset($mm_abort_edit) || !$mm_abort_edit) {
if ((isset($_POST["MM_insert"])) && ($_POST["MM_insert"] == ....


This will fix the issues you have with insert and resize.

Replies

Replied 08 Jan 2015 14:21:36
08 Jan 2015 14:21:36 Teodor Kuduschiev replied:
Please email us the ftp details, so we can test what exactly is wrong there.
Replied 08 Jan 2015 14:28:34
08 Jan 2015 14:28:34 Michael Bosquez replied:
I just rebuilt the page myself and got it to work. Not sure what's wrong with the file you sent. Once I rebuilt it, manually fixed the Insert Record behavior, and manually adjusted the order, it worked fine. That was faster that trying to debug your page.

I wish you guys would just fix the extension. I understand you're saying it's an Adobe issue, but since the Insert Record behavior is added first, and the your extensions come along and make modifications, it seems your extension isn't adding the code you have us manually add.

Mike
Replied 10 Jan 2016 19:46:19
10 Jan 2016 19:46:19 Gary Block replied:
Just a note on the resize extension from DwZone-it mentioned previously in this topic. I've used this extension and it is limited to three image sizes. So you can resize the main image with the same file name and have two other images with different dimensions and file names. And the crop feature is not automatic. It's a separate function users have to apply manually. For my purposes, I frequently want to create cropped, square thumbnails and have more than three image sizes.

Reply to this topic