Welcome Guest, Not a member yet? Register   Sign In
Developers Library image
#1

[eluser]Unknown[/eluser]
Forgive me for my English, I'm Russian and I use google translation, because if I write myself you just do not understand anything xD

I'll start with the fact that I recently started working with Codeigniter and stalknulsya below given problem.

Just popping in the standard library image I had to take advantage of cutting images (crop).
Everything is simple and clear, but noticed a flaw and I believe that this defect framework developers simply forgot to add , as the crop is not working properly , and I spent half a day on it with red eyes sitting at the computer screen and not knowing what the thing is .

Actually when using the crop, while cutting image he cuts them by default on the left , if you do not specify the width (for example) the image.
That's right , and everything is as it should be, but if you want to crop images on both sides , you will encounter the following problem .

Say you have a 1000x1000 image , and you have to cut it to the width of 501px ( 501px note have no chance. )
When setting the size to 501px in width aspergillum you divide the residue 499 in half to cut both sides of the picture in this situation we
(1000-501) / 2 = 249.5
stalnuvshis of shot image library does not take it for size and simply pass / not cut the image .
the solution is simple
Code:
round ('249, 5 ' )




Theme © iAndrew 2016 - Forum software by © MyBB