Jump to content

Filename generating


wattee

Recommended Posts

Hi

 

I have a problem with generating enough filenames.

 

I have 2 functions, 

 

The base of the 1st function is this:

 

            foreach ($arry as $i => $ystart) {
			$pic = $this->pilt();
                $pic->cropImage(256,256,$xstart,$ystart);  
   			$failinimi = "bunny/bunny_0" . $i . ".png";    
            $pic->writeImages($failinimi, false); 

        }

What it does is that it takes an image crops it vertically like a column into 256pixel pieces. $ystart array has values inside the function and $xstart array gets passed in.

Now the problem is the auto generating filename, since width is usually wider than heigth it only generates filename numbers as much there is height pieces.  Therego it overwrites the picture files as many times there are width pieces($xstart).

What i want is to get all the sliced images with different names. As if there was 24 pieces(like 4 height, 6 width) i'd name them 1-24.

 

 

This is from my other function, passing the argument.

 

foreach ($arrx as $xstart){
		$this->loigu($xstart);

	}

 

 

Would greatly appreciate the help you can give me.

Link to comment
https://forums.phpfreaks.com/topic/202725-filename-generating/
Share on other sites

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.