Welcome Guest, Not a member yet? Register   Sign In
uploading and using images
#41

[eluser]M4rc0[/eluser]
Yes it was, silly me.

First i was passing the paramater as append and not prepend, fixed by moving the prepending to the correct parameter order (fourth):
Code:
$image->resize(120,140,'','_thumb');

Then it was working but doing .jpg_thumb, so here's the correct code:
Code:
if($this->new_name){
                    $save_path = $this->tmp_dir.$append.$this->new_name.$prepend.'.'.$this->type;
                }else{
                    $save_path = $this->tmp_dir.$this->encrypt_name().'.'.$this->type;
                }

So i can say everything is done now :cheese:

Amazing topic, thanks for everything textnotspeech!

I'm attaching the imagination modified library, together we made it better then CI's, so if somebody searchs for resizing hopefully it will end here ;-)
#42

[eluser]textnotspeech[/eluser]
Cool. I wanted to tweak this to be a bit more versatile and ultimately portable. I created this class for a specific purpose and I think now it's more what it should be. I'd like to tweak it a bit more to be a little more user friendly and provide a rock solid api. Not sure if you're interested, but I have another extension I find immensely useful for configuring the header HTML files. This one is fully documented (it even uses CI's doc template and there's instructions on putting it right in the user guide). Check it out here. I'd like to eventually release the imagination class with the same amount of polish.
#43

[eluser]M4rc0[/eluser]
Oh I'm definitely interested. I'm also curious how the validation of the image size would be.

If you need help with your polish or just ideas you can pm anytime.
Also don't forget to tell me if you release a new version later Smile

For the HTML files i'm using the Template library as i'm working with templates, but i checked the examples and dynamic title surely looks interesting (donno if i can do that with template library). Maybe i'll look into that.

Thanks again!
#44

[eluser]textnotspeech[/eluser]
Do you mean file size or dimensions? I typically like variables that I set defaults in the constructor so it's easy to configure. The validate function would check the image size against default and would need to be modified to return more than just true or false.
#45

[eluser]M4rc0[/eluser]
I mean file size. I realize that you have to complain about the file size before you do the resize() or else php will do a fatal error and won't even reach the resize function.

At least here it's what happened, i tried adding a function in imagination that would return file size and then check in the controller if it's big, but i would get a fatal error before reaching there.
So it has to be caught before the temp uploading.

So before the imagination work it should have condition like $_FILES['field']['size'] > 3000 or something.
Here it didn't work but this is something for later Smile

This time if you didn't get it i'll understand because not even i am after reading this haha
But if you try adding a big file you will see what i mean, php complains first as a fatal error before imagination's complaint.

Well, just talking here. No more help needed Smile
Don't forget to let me know if you change something!

Thanks for the lib!




Theme © iAndrew 2016 - Forum software by © MyBB