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 11 Feb 2013 13:24:15
11 Feb 2013 13:24:15 Vulcho Vulev replied:
Hello Jean.

Can you explain a little bit more detailed what you mean with:
Quote
but resizing and inserting the text for the watermark is not Ok?

Is the watermark text applied? Is the watermark correctly positioned ?
Is the resize option applied to the image?
Can you please send me your page at my e-mail: ?

Best regards:Vulcho.
Replied 14 Feb 2013 19:27:39
14 Feb 2013 19:27:39 Jean Pierre Valls replied:
Hello,
In my form, I would download an image and make insertion into a database, so I use Pure PHP Upload 2.
Then I added the server comportementement Smart Image Processor PHP 2 to apply a resize my image and insert a watermark, text format.
The result is:
Download and inclusion in the database are correct.
but:
Resizing and watermark are not applied to the image uploaded.

My question is, why it does not work.
Thank you for your response
cordially
Replied 15 Feb 2013 08:26:25
15 Feb 2013 08:26:25 Vulcho Vulev replied:
Hello Jean.

I was unable to recreate the issue here.Maybe you are using more specific settings. Can you please send me your page at my e-mail:

Regards:Vulcho.
Replied 16 Feb 2013 09:05:02
16 Feb 2013 09:05:02 Jean Pierre Valls replied:
Hello Vucho,
I have sent you a personal email

cordially
JPierre
Replied 18 Feb 2013 08:48:34
18 Feb 2013 08:48:34 Vulcho Vulev replied:
Hello Jean.

Currently your page is inserting the record before the script of the extensions is executed.If you open "server behaviors" you will be able to see that.
Your sequence is :

Insert Record
Pure PHP Upload
Image Processor PHP 2.0.9

The correct sequence is:

Pure PHP Upload
Image Processor PHP 2.0.9
Insert Record

Please make sure when constructing the page that you place first the Pure PHP Upload , after that The Smart Image Processor PHP and your insert record behavior is last.

Regards:Vulcho
Replied 18 Feb 2013 13:36:09
18 Feb 2013 13:36:09 Jean Pierre Valls replied:
Hello Vulcho

I respected the order construction of the page

Pure PHP Upload
Image Processor PHP 2.0.9
insert Record

But I have the same problem
Upload and Inserting record -> OK
Resizing --> Nok
Watermark -> Nok

Do you have an example page to show me?
Thank you for your help

Regards : Jean Pierre

Replied 19 Feb 2013 09:36:05
19 Feb 2013 09:36:05 Vulcho Vulev replied:
Hello Jean.

Please check your e-mail. I sent you working example of the code construction sequence.

Regards:Vulcho.
Replied 19 Feb 2013 13:35:58
19 Feb 2013 13:35:58 Jean Pierre Valls replied:
Hello Vulcho

Thank you for your help

I'm try again

Regards : Jean Pierre
Replied 26 Dec 2014 20:08:25
26 Dec 2014 20:08:25 Michael Bosquez replied:
The answer from Vulcho above is not correct. I have built a page and put everything in the order stated:

Pure PHP Upload
Image Processor PHP
insert Record

That doesn't work. Resize does not function. However, if I remove the Insert Record, it works just fine. Bottom line is you can't have an Insert Record on the page and expect images to be resized.

I have also tried every other order imaginable. Nothing works except deleting the Insert Record.

If anyone has found an actual solution to this issue, please reply.

Thanks,
Mike
Replied 27 Dec 2014 07:36:45
27 Dec 2014 07:36:45 Jean Pierre Valls replied:
Hello,
I make the same observation, everything works if we do not insert into a database.
Yet the function insert and resize pictures are the most used on the web.
Thank you to the team and DXZonne Vulcho us found a solution, if would be nice.
Personally I have not found a solution.
Best Season.
Best Regards
Jean-Pierre
Replied 27 Dec 2014 16:47:35
27 Dec 2014 16:47:35 Michael Bosquez replied:
Thanks, Jean-Pierre. I am using this with php upload 3 so it doesn't work with the new one either. I wish they'd either fix the problem or stop advertising that this resizing extension works. It does not work if you need to insert into a database which is a very common need. I have found that the extension works on a folder. So I waste processing power by processing a folder over and over again every time a page is called to view contents. I'm going to try it on a record set next. I think I can make it work that way and not have it continuously resize. I'll post here in the next few days if I get that to work. And, I'll post a real solution if I find one to allow a database insert.

I wish DMXZone would fix this issue. But given the number of posts and the age of many of them they appear to have no interest in fixing it.

Happy Holidays!

Mike
Replied 27 Dec 2014 18:38:38
27 Dec 2014 18:38:38 Michael Bosquez replied:
Well, the extension doesn't work on a recordset. I can only get it to work when used with Pure PHP Upload 3 and no Insert Record behavior, or when resizing a folder. Further, and consistent with other posts in this forum, it will not resize anything right out of a digital camera. I can resize a folder as long as the original images are small. I uploaded one from my digital camera that is over 5M and I get a fatal memory error.

Not a very useful extension. Debating whether I'll demand a refund. And if I do, and they won't grant it, then I'll dispute it with PayPal. I just bought this extension a few days ago and it does not work as advertised. The posts in this forum say a lot about the issues with the extension and over the past 3 to 4 years DMXZone has done nothing to fix it.

Has anyone out there found a resizing extension from someone else that actually works?

Thanks,
Mike
Replied 27 Dec 2014 18:52:56
27 Dec 2014 18:52:56 Michael Bosquez replied:
Jean-Pierre,

I found an extension from DwZone-it.com that claims to do the same thing. PHP Upload and image resize. I've had good luck with his extensions in the past and great luck when a bug exists. He's very responsive and fixes them quickly. I haven't bought it yet. I'll likely buy it on Monday and give it a try. I'll report back here once I know if it works. Here's the link:

www.dwzone-it.com/Extension/PhpUploadResize/default.asp

In the meantime, I wish the DMXZone guys actually read these forums and replied.....and maybe even fixed the issues.

Thanks,
Mike
Replied 28 Dec 2014 09:31:41
28 Dec 2014 09:31:41 Jean Pierre Valls replied:
Hello Michael,
Thank you for the information, simple question, are you a french user?
I hope the team will DMXZONNE necessary to find a proper solution. An idea, integrate resizing in Pure PHP Upload 3 and we would have the opportunity to use it directly in the upload.
Best Regards
Jean-Pierre
french user
Replied 28 Dec 2014 15:22:21
28 Dec 2014 15:22:21 Michael Bosquez replied:
Thanks, Jean-Pierre. No, I am not a French user. I, too, hope the guys at DMXZone do something to help with this issue. But it looks like they're no longer reading these posts.

Thanks,
Mike
Replied 29 Dec 2014 15:31:35
29 Dec 2014 15:31:35 Michael Bosquez replied:
Jean-Pierre,

I bought and tested the extension from DWZone-it.com and it works great!! No issues at all. Per above, the extension can be purchased here:

www.dwzone-it.com/Extension/PhpUploadResize/default.asp

I've bought a few extensions from that site over the years and they mostly work. When there are issues, he responds and fixes them ASAP.

The PHP Upload and Resize extension has everything built into one extension. It does the database insert, the image resize, the thumbnail creation, and it has other features like Delete.

Good luck, but again, the extension from DWZone-it.com works great and does not have any of the issues we're finding with the extension from DMXZone.com.

Mike
Replied 05 Jan 2015 10:58:52
05 Jan 2015 10:58:52 Teodor Kuduschiev replied:
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.
Replied 05 Jan 2015 21:21:15
05 Jan 2015 21:21:15 Michael Bosquez replied:
Technically, you are correct. This does allow one instance of the Smart Image Processor to fire. However, now the filename does not insert to the MySQL database. Therefore, even though the resizing now works, it is still of no value because the Insert Record behavior stores everything but the filename. We need to find a solution that allows the record to be completely inserted and an image must be resized, and a second instance of the Image Processor must be able to run to create a thumbnail.

Applying your code above resizes once with no thumbnail and no stored filename.

Any suggestions are greatly appreciated. In the meantime, I'm going back to the DWZone-it extension. It works. I'd love to get the DMXzone extensions working. They all work great in ASP. Can't make many of them work in PHP.

By the way, the redirect is in the second Image Processor instance. All others are blank. I tried it in the Insert Record behavior also. Same result as described above.

Mike
Replied 05 Jan 2015 21:26:08
05 Jan 2015 21:26:08 Teodor Kuduschiev replied:
Please email your php file, to so i can check what exactly is wrong.
Replied 05 Jan 2015 22:03:31
05 Jan 2015 22:03:31 Michael Bosquez replied:
I emailed it.

Mike
Replied 06 Jan 2015 10:42:04
06 Jan 2015 10:42:04 Teodor Kuduschiev replied:
Thanks,
I edited the code of your page. Seems to me you did not add the extensions and insert record using the right order.
I moved the Pure PHP Upload code BEFORE the insert record code, as it should be.
Also - the second Smart Image processor was working just fine, it is you who entered wrong mask for the filename. I edited it from "##small_##name##.jpg" to "##path##small_##name##.jpg"
I also moved the Pure Upload and Smart Image processor includes, before the Pure Upload Code. I emailed you the edited page back.
Replied 06 Jan 2015 15:53:08
06 Jan 2015 15:53:08 Michael Bosquez replied:
Thanks, Teodor, but this is part of the problem many of us are having. See the reply you sent me yesterday. In it you say:

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

So that's exactly what I did. Now, you're telling me I did it wrong and you had to move the PHP Upload to appear before the INSERT RECORD. Also, because there are answers in the support forums that tell you every order imaginable, I tried multiple and none of them worked....for me.

Second, I don't want the path to be stored. That's why I didn't include ##path in the mask. Will it only work if I include the path?

Finally, is there any advice you can provide as to how we make pages like this ourselves so that we don't have to email them to you for hand coded fixes?

I'll try the page you sent back and see how it goes.

Thanks,
Mike
Replied 06 Jan 2015 16:12:49
06 Jan 2015 16:12:49 Teodor Kuduschiev replied:
Hello,
If you follow the order mentioned in your post the code should end up like i sent it to you - PPU code before the insert record. - Yes that is right you first add the Insert Record and then PPU, but PPU Places its code automatically before the insert record code.

Also - the mask is not getting stored in the database... the image name of the uploaded file is being stored there. ##path## indicates where to save the file (##path## points to the uploaded file location).
Replied 06 Jan 2015 17:17:35
06 Jan 2015 17:17:35 Michael Bosquez replied:
OK, thanks. I'll have time to check this out tomorrow and will let you know how it goes.

Thanks,
Mike
Replied 08 Jan 2015 14:13:40
08 Jan 2015 14:13:40 Michael Bosquez replied:
I had some time today so I checked out the file you sent me. Nope. It won't even load. It comes up blank. No error. No content. Nothing.

Mike

Reply to this topic