You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
jpegdecompresssurface : picture decode failed : e00002d1
I can get exact same data as image data from sql server.
So i try to load image from NSData, below the code,
(void)process:(NSArray*)results
{
NSArray *table=[results objectAtIndex:0];
NSDictionary *row=[table objectAtIndex:0];
NSData *image_source=[row objectForKey:@"Company_Logo"];
UIImage *image=[[UIImage alloc] initWithData:image_source];
image=[UIImage imageWithData:image_source];
[self.imageView setImage :image];
}
but the final step , it is showing like this, in here
// [self.imageView setImage :image];
jpegdecompresssurface : picture decode failed : e00002d1
How can i solve this?
Regards.
I used types branch and used the sample project for testing but same.
can you give me the source code for that?
I checked the
NSData *image_source=[row objectForKey:@"Company_Logo"];
by log the value.
but same as data in sql.
How can i use this for mapping to uiimage type?
can you teach me?
i want your reply. thanks .
king regards,
I am using the SQL EXPRESS 2016.
I used the Company_Logo(image,null) for saving/loading image.
Additionally, I am trying to load the image that saved by C# program i made.
In android , the image can be read by byte array and convert that to bitmap image, and it is working.
In C# , it is also working well.
but in iOS when i tried to do like that with above code , it is showing
jpegdecompresssurface : picture decode failed : e00002d1
Hello , Mr.Martin Rybak.
I tried to debug the code and found something related.
So, (void)process:(NSArray*)results
{
NSArray *table=[results objectAtIndex:0];
NSDictionary *row=[table objectAtIndex:0];
NSData *image_source=[row objectForKey:@"Company_Logo"];
UIImage image=[[UIImage alloc] initWithData:image_source];
image=[UIImage imageWithData:image_source];
[self.imageView setImage :image];
}
in this code ,(NSArray) results is returning values from sql.
in here , i checked the @"Company_Logo".
It was NSInlineData and 4096bytes.
That's why the above 5kb jpg image is not showing full.
I tried to use small jpg image (for example 400bytes) , and it is showing well.
Can you give me some solution for large image?
Really thanks for your help.
Regards.
I got file path using your reference source code ,
"/var/containers/Bundle/Application/0E8B03A5-869A-4435-AE41-21972F55CA4B/SQLClient.app/freetds.conf"
so i set above path as value of FREETDS.
On Sat, Aug 4, 2018 at 12:38 PM, Harikant Amipara ***@***.***> wrote:
i facing this issue in my iOS app. please help me out. thank you.
in android application is working fine to get binary image from SQL server
but facing issue in iOS and load some part of image only.
—
You are receiving this because you authored the thread.
Reply to this email directly, view it on GitHub
<#40 (comment)>,
or mute the thread
<https://github.com/notifications/unsubscribe-auth/ATFs4zEkmQotzpgfH0rTkdfuzxIYLI7vks5uNTM4gaJpZM4LrSNS>
.
Activity
martinrybak commentedon Jan 23, 2017
Please try the
typesbranch.totoourworld commentedon Jan 23, 2017
I used types branch and used the sample project for testing but same.
can you give me the source code for that?
I checked the
NSData *image_source=[row objectForKey:@"Company_Logo"];
by log the value.
but same as data in sql.
How can i use this for mapping to uiimage type?
can you teach me?
i want your reply. thanks .
king regards,
martinrybak commentedon Jan 23, 2017
It could be related to this:
https://msdn.microsoft.com/en-us/library/ms177687(v=sql.90).aspxWhat version of SQL Server are you using?
What data type is the column with the image?
If possible, can you attach the image file here?
totoourworld commentedon Jan 24, 2017
I am using the SQL EXPRESS 2016.
I used the Company_Logo(image,null) for saving/loading image.
Additionally, I am trying to load the image that saved by C# program i made.
In android , the image can be read by byte array and convert that to bitmap image, and it is working.
In C# , it is also working well.
but in iOS when i tried to do like that with above code , it is showing
jpegdecompresssurface : picture decode failed : e00002d1
totoourworld commentedon Jan 24, 2017
totoourworld commentedon Jan 24, 2017
totoourworld commentedon Jan 24, 2017
totoourworld commentedon Jan 24, 2017
totoourworld commentedon Jan 24, 2017
These three pictures , i used to try.
jpg file looks like that issue , but png file is not showing at all.
totoourworld commentedon Jan 24, 2017
Hello , Mr.Martin Rybak.
I tried to debug the code and found something related.
So, (void)process:(NSArray*)results
{
NSArray *table=[results objectAtIndex:0];
NSDictionary *row=[table objectAtIndex:0];
NSData *image_source=[row objectForKey:@"Company_Logo"];
UIImage image=[[UIImage alloc] initWithData:image_source];
image=[UIImage imageWithData:image_source];
[self.imageView setImage :image];
}
in this code ,(NSArray) results is returning values from sql.
in here , i checked the @"Company_Logo".
It was NSInlineData and 4096bytes.
That's why the above 5kb jpg image is not showing full.
I tried to use small jpg image (for example 400bytes) , and it is showing well.
Can you give me some solution for large image?
Really thanks for your help.
Regards.
martinrybak commentedon Jan 24, 2017
Please put a breakpoint on line 544 of
SQLClient.m:https://github.com/martinrybak/SQLClient/blob/types/SQLClient/SQLClient/SQLClient/SQLClient.m#L544
What is the value of
column->size?totoourworld commentedon Jan 24, 2017
in image type the column size is 4096
totoourworld commentedon Jan 24, 2017
column->size is 4096
martinrybak commentedon Jan 24, 2017
OK, to be sure, put a breakpoint on this line and verify that
dbcollen(_connection, c)is returning 4096 for your image column.https://github.com/martinrybak/SQLClient/blob/types/SQLClient/SQLClient/SQLClient/SQLClient.m#L261
martinrybak commentedon Jan 24, 2017
Also try changing your data type from
imagetovarbinary(max)9 remaining items
totoourworld commentedon Jan 24, 2017
I got file path using your reference source code ,
"/var/containers/Bundle/Application/0E8B03A5-869A-4435-AE41-21972F55CA4B/SQLClient.app/freetds.conf"
so i set above path as value of FREETDS.
totoourworld commentedon Jan 24, 2017
what value would i check by debugging?
totoourworld commentedon Jan 24, 2017
martinrybak commentedon Jan 24, 2017
The value must be relative to your app. Try
freetds.confinstead.totoourworld commentedon Jan 24, 2017
I changed with your instruction
and tested , again . but the column->size of image is still 4096
totoourworld commentedon Jan 24, 2017
martinrybak commentedon Jan 24, 2017
Try setting other values to verify that TDS is finding your file.
http://www.freetds.org/userguide/freetdsconf.htm
totoourworld commentedon Jan 24, 2017
i setup the sql express 2016 to other computer windows 10 system.
in here , TDS version how can i check this?
I am really sorry for bothering your time, but can you teach me via my screen? like using teamviewer,sir?
martinrybak commentedon Jan 24, 2017
I'm sorry, I can't do that. Please do some reading up on FreeTDS until you can customize the
text sizesetting. I think that is the problem.totoourworld commentedon Jan 25, 2017
so the conclsion is change the text size?
amiparaharikant commentedon Aug 4, 2018
i facing this issue in my iOS app. please help me out. thank you.
in android application is working fine to get binary image from SQL server but facing issue in iOS and load some part of image only.
totoourworld commentedon Aug 4, 2018
amiparaharikant commentedon Aug 4, 2018
@totoourworld i'm getting size of image is still 4096
martinrybak commentedon Aug 4, 2018
https://stackoverflow.com/questions/4500506/php-is-truncating-mssql-blob-data-4096b-even-after-setting-ini-values-am-i-m
amiparaharikant commentedon Aug 4, 2018
is this issue of getting size of image 4096byte is from SQL SERVER ?