CodeIgniter image manip. script mixing up file names -


This is a CodeIgniter application that uses its Image Manipulation Library.

$ photos has an array of relative photo paths. This script should resize the original and also create a medium (_m) and small (_s) size.

When I only send a photo to the script, everything works great.

When I send each other, things get worse - the first image works fine, but then:

- The original second image is not changed at all ( It should be changed to more than 800 wide / high size)
> "Original" second image size (800x800) is named as a small image with the first image file name .

  foreach ($ photos $ photos) {$ config ['image_library'] = 'GD2'; $ Config ['source_image'] = $ photo; $ Config ['maintain_ratio'] = true; $ Photoparates = pathfinfo ($ photo); // Change the size of the original $ config ['width'] = 800; $ Config ['height'] = 800; $ This- & gt; Image_lib- & gt; Start ($ config); $ This- & gt; Image_lib- & gt; Resize (); // medium size $ config ['width'] = 500; $ Config ['height'] = 500; $ Config ['new_image'] = $ photoparts ['dirname']. / '. $ Photoparts ['filename']. ' _M '. $ Photoparts ['Extension']; $ This- & gt; Image_lib- & gt; Start ($ config); $ This- & gt; Image_lib- & gt; Resize (); // small size $ config ['width'] = 200; $ Config ['height'] = 200; $ Config ['new_image'] = $ photoparts ['dirname']. / '. $ Photoparts ['filename'].'_s' $ Photoparts ['Extension']; $ This- & gt; Image_lib- & gt; Start ($ config); $ This- & gt; Image_lib- & gt; Resize (); }  

I do not understand for my life why file names are mixed, I can think that I am doing all this on a local server, so maybe this fast Is the script going on already moving forward? I suspect that this is the case, though.

I finally got to know this - I think I was the other Modifying the source image, so when I take that part to the end, then everything works fine.


Comments

Popular posts from this blog

c# - sqlDecimal to decimal clr stored procedure Unable to cast object of type 'System.Data.SqlTypes.SqlDecimal' to type 'System.IConvertible' -

Calling GetGUIThreadInfo from Outlook VBA -

Obfuscating Python code? -