By Philidia on Monday, 04 January 2016
Posted in General Issues
Likes 0
Views 1.2K
Votes 0
Hello!

I found a very weird bug on EB5. It's something that was already happening on EB3.9, but it's more problematic with EB5. Let me bring some context.

I make a lot of articles, and use a lot of images. Sometimes, I use my own reflex to get some pics, especially when it's about conventions. No problem, I get those pic, but when I try to upload them on Easyblog, I have a bug with some pics. After further investigations, here is when the bug happen :

1) The image must have a ratio higher than 1 (Like 16/9)
2) AND The image has exif informations
3) AND The image is uploaded on EB, no matter what you use (Media manager, block, etc...)

On Easyblog 3.9, when I tried to do it with those conditions, I was getting an error while uploading: "Can't parse server response". However, If I saved the article as a draft, then went back on it, pics would appears on the media manager. The same thing happens on Easyblog 5, though, since I use blocks that don't allow to select an image on the media manager, if the uploads fails, I'm fucked

So, since the problem was happening only with pics I took with my reflex, I tried to see what those pics had that other pics didn't have. Since my reflex use EXIF informations to add some details on the properties of the image, I took a look on it, and tried to remove them, then upload again. The bug didn't happen. It means something on those EXIF informations seems to make this problem happening.

Now, some details. Here is a comparison of 3 files (Properties of those pics). On the left, the image making the bug happening. On the center, another image took with my reflex, but with a ratio lower than 1, so, not making the bug happening. On the right, the same image than on the left, but with exif information removed using the link on the bottom of the windows :





I also uploaded those 3 images (In the same order), to let you look at those pics, and maybe find what's causing this problem.

To reproduce the bug on EB5 (With composer):
1) Create a new article
2) Add a "thumbnails" block
3) Select a "problematic" file (here it's the 585.jpg)
4) The animation with the circle appears to show the pic is getting uploaded
5) You can't wait for a long time, the pic will never appears
6) [Optional] Save the article for later (draft)
7) [Optional] Get back on the article
8) [Optional] Click on "add media", and select "this post". The pics that didn't appear before was in fact properly uploaded, but didn't appear on the block.

To reproduce the bug on EB3.9 :
1) Create a new article
2) Add a media on the article using the media manager
3) Drag and drop the pic on the media manager (585.jpg)
4) The pic is uploaded, but you'll get an error saying "can't parse server response"
5) Go back to the navigation on the folder you tried to upload the file. It won't appear.
6) [Optional] Save the article as draft
7) [Optional] Get back on the article
8) [Optional] Try to add a media, and browse the file on the folder where you tried to upload the pic before. It now appears properly, and you can insert it on the article without any other problem.

On EB3.9, it wasn't really a problem. I mean, It's not a hard thing to save as draft then going back on the article. But on EB5, some block won't let you choose a file using the media manager, and you have to upload them. So, if the upload fails, well... It'll be hard to do something

I know it's not a bug easy to reproduce, so, feel free to ask me more details. I also can understand that because of how hard it is to reproduce this bug, you won't priorize a fix or even make one. Since I know how to fix the problem now, I can deal with it anyway. But I hope it's a very isolated case
Hey there,

Hm, it seems like exif_read_data is hitting errors with these exif information,


Illegal IFD size: 2 + x2800*12 = x1E002 &> x1E98


Perhaps we should silent the exif_read_data to avoid errors like this in the future. Try this, edit the file /administrator/components/com_easyblog/includes/simpleimage/simpleimage.php and at line 109, locate the codes below:


$exif = exif_read_data($this->path);


Replace it with,


$exif = @exif_read_data($this->path);


The only reason we read the exif data is for the screen orientation so that we can rotate the image accordingly and even if the rest of the data is not imported, I guess it's perfectly fine.
·
Monday, 04 January 2016 21:18
·
0 Likes
·
0 Votes
·
0 Comments
·
Thanks a lot

I'll try the fix as soon as possible, and will tell you if everything is ok.
·
Monday, 04 January 2016 22:34
·
0 Likes
·
0 Votes
·
0 Comments
·
No problem
·
Tuesday, 05 January 2016 02:12
·
0 Likes
·
0 Votes
·
0 Comments
·
Interesting, I have had a similar problem with one of my more active sites today. It is fully up to date on all its software.
My customer could not upload a cover image using the direct "upload cover button" but I was able to do so by first using the "Browse Media" then upload the same image then select it.
I spent some time trying to solve this but then stumbled on the fact it was image retailed which lead me to this posting.
I have attached the image which still seems to reliably fail to upload. I even tried the same image on a totally different installation on another server. I have confirmed that if I read that image into Photoshop and save it back again with a new file name it will load, so in my case there is more to it than image size. My checks on the photo suggest it is a legal file format and I get no format or read errors. I did try the mod, not sure it is relavent in my case but it did nothing.
·
Thursday, 07 January 2016 11:46
·
0 Likes
·
0 Votes
·
0 Comments
·
Hello Stephen,

Your issue might have a different cause. Can you create a new thread for your issue with your backend and FTP access?
·
Thursday, 07 January 2016 13:39
·
0 Likes
·
0 Votes
·
0 Comments
·
I added the information as a possible help but at this stage I cannot give you access to the websites. They are big commercial sites and I have strong security procedures. If I get some time I will try the problem on a virgin site and report back.
·
Thursday, 07 January 2016 22:35
·
0 Likes
·
0 Votes
·
0 Comments
·
Stephen, did you try my fix above? Because I tried uploading the image that you have just uploaded locally and it works fine.

If you are still experiencing issues after applying my fix above, when your site is ready for access and ready for us to troubleshoot, please start a new ticket with your site details
·
Thursday, 07 January 2016 22:41
·
0 Likes
·
0 Votes
·
0 Comments
·
Hello Mark

I tried the fix with this :

$exif = @exif_read_data($this->path);


I can confirm it works fine now. However, will you include it on the next version of Easyblog, or should I again edit it later?

Also sorry for the delay, busy with the start of the year
·
Tuesday, 12 January 2016 15:59
·
0 Likes
·
0 Votes
·
0 Comments
·
Yep, this will be fixed in the next release of EasyBlog
·
Tuesday, 12 January 2016 17:10
·
0 Likes
·
0 Votes
·
0 Comments
·
View Full Post