[solved] help me find a bug with file uploading |
[eluser]SPeed_FANat1c[/eluser]
Hi, Code: if(!$this->upload->do_upload()) This is code fragment from file uploading function. This works well when image_width is not > 700. But when it is > 700, then the thumbnail is not created. Now here you can see gallery_thumb function in Image_model: Code: function gallery_thumb($album_folder,$image_name) gallery_thumb is returning TRUE, I assume this because this Code: if($this->image->gallery_thumb($this->input->post('album_folder'),$data['file_name'])) echoes $data['file_name']; Where the problem could be that it does not create thumbnail when image_with is > 700 ?
[eluser]toopay[/eluser]
did your ' if($data['image_width'] > 700)' statement fired?
[eluser]SPeed_FANat1c[/eluser]
[quote author="toopay" date="1303866860"]did your ' if($data['image_width'] > 700)' statement fired?[/quote] yeah, I made an echo inside the { } and it was echoed.
[eluser]astrofire[/eluser]
I m wondering why you differentiate between <700 and >700 width pics. Why not pushing all images through the same thumbnail procedure?
[eluser]toopay[/eluser]
Looks lke to me, that your execution break somewhere in 'image_resize_for_gallery' function on 'Image_model'.
[eluser]SPeed_FANat1c[/eluser]
Quote:I m wondering why you differentiate between <700 and >700 width pics. There are two reasons: 1. If the picture is more than 700, then I resize and it is smaller, loads faster on a webpage. 2. I use galleria plugin http://galleria.aino.se/ and if the picture is bigger then it shows it wrong (not rezised) and on IE throws javascript errors. If the picture width is less than 700 I don't need to execute resizing script. Ok, I post an image model code: Code: <?php
[eluser]toopay[/eluser]
Have you try to put this flag Code: $this->image_lib->clear();
[eluser]SPeed_FANat1c[/eluser]
[quote author="toopay" date="1303919791"]Have you try to put this flag Code: $this->image_lib->clear(); Added. Code: function image_resize_for_gallery($source_image) Now from this part Code: if($this->image->gallery_thumb($this->input->post('album_folder'),$data['file_name'])) I get 'Nepavyko įkelt mažos nuotraukytes:err' so at least it says that it not created thumbnail. So I made a model function to echo a message why it does not create a thumbnail: Code: function gallery_thumb($album_folder,$image_name) And I get this: <p>Your server does not support the GD function required to process this type of image.</p> I am testing only with .jpg images. I remind you - If the image is not resized, then thumbnail is created. But when the resizing is executed, then I get this error. So it means that it does not understand the image type or change it after resizing..
[eluser]toopay[/eluser]
Have you try to include 'create_thumb' on resize config at 'image_resize_for_gallery'?
[eluser]SPeed_FANat1c[/eluser]
[quote author="toopay" date="1303922646"]Have you try to include 'create_thumb' on resize config at 'image_resize_for_gallery'?[/quote] I think there is no point to do that, because create_thumb is already in gallery_thumb function. Also Quote:For practical purposes there is no difference between creating a copy and creating a thumbnail except a thumb will have the thumbnail marker as part of the name (ie, mypic_thumb.jpg). so it just changes a file name.. |
Welcome Guest, Not a member yet? Register Sign In |