• Open Menu Close Menu
  • Apple
  • Shopping Bag
  • Apple
  • Mac
  • iPad
  • iPhone
  • Watch
  • TV
  • Music
  • Support
  • Search apple.com
  • Shopping Bag
 

Lists

Open Menu Close Menu
  • Terms and Conditions
  • Lists hosted on this site
  • Email the Postmaster
  • Tips for posting to public mailing lists
RE: Problem using WOimage
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

RE: Problem using WOimage


  • Subject: RE: Problem using WOimage
  • From: "Kranthi Sagar Borra" <email@hidden>
  • Date: Thu, 29 Jan 2004 13:30:05 +0530
  • Thread-topic: Problem using WOimage

Hi ,

.Actually when I execute the query, I get a sting which is in BINHEX encoding so I am converting that to binary and then creating an NSData.This is what i am doing.


        Application app = (Application)application();
        JadeDBQuery query = new JadeDBQuery(app.getDefaultSignature());
        query.setContext(getJadeContext());
        String sqlQuery = "select PictureObj from ProblemPicture where ProblemID =" + problemID;
        try
        {
            query.Do(sqlQuery, true);
        }
        catch(JadeQueryException ex)
        {
            setErrorMessage("Error during picture download.");
        }
        String result = query.getCellAsString(1, 1);

        if(result == null)
        {
            setErrorMessage("No Picture to View");
            displayString = "";
        } else
        {
            //hextobin will retrun me a byte array.
            ImageBLOBData = new NSData(WebRadarUtility.hexToBin(result));

        }

And I am mapping ImageBLOBData to data of WOImage.Its working fine if the image is small in size , but if it is large, then I am not able to view the image.Its neither throwing me any error too.Everything is perfectly show in the log.Even ImageBLOBData is also getting generated.Can you please tell me where I am going wrong.Thank you.

Regards
Kranthi.

> ----------
> From: 	Jonathan Rochkind
> Sent: 	Tuesday, January 27, 2004 11:06 PM
> To: 	Kranthi Sagar Borra; email@hidden
> Subject: 	Re: Problem using WOimage
>
> Check the logs of your app, but I suspect you are running out of
> memory.  WOImage with a 'data' binding is a huge memory hog---and
> depending on whether you bind the 'key' binding, either it's a memory
> _leak_ too, or the URL generated will only work _once_ (and may still
> be a memory leak if the URL is never accessed).
>
> Personally, I reccomend absolutely avoiding WOImage with the 'data'
> binding.   One alternative is this component:
> http://WOCode.com/cgi-bin/WebObjects/WOCode.woa/2/wa/ShareCodeItem?itemId=309
>
> Better yet, would be something similar to the code there, but using
> the new WO 5.2 streaming APIs to stream the image back to the
> browser, if at all possible. Depending where you are getting the
> image data from, if you can avoid having the entire image in your
> application memory at once ever, that would be much preferable.
>
> --Jonathan
>
> At 2:33 PM +0530 1/27/04, Kranthi Sagar Borra wrote:
> >  > Hi,
> >>
> >>  I have a problem viewing images.I have mapped NSData to data of
> >>WOImage and set the mimetype to "image/gif".I have defined NSdata
> >>object as
> >>
> >>  NSData=ImageBLOBData = new NSData(byte[]);
> >>
> >>  This works fine if my byte array is small in size.But if its
> >>large, then I cannot view any picture.Its neither throwing me an
> >>error or exception.Can somebody tell me where I am going
> >>wrong.Thanks in advance.
> >>
> >>  Regards,
> >>  kranthi
> >_______________________________________________
> >webobjects-dev mailing list | email@hidden
> >Help/Unsubscribe/Archives:
> >http://www.lists.apple.com/mailman/listinfo/webobjects-dev
> >Do not post admin requests to the list. They will be ignored.
_______________________________________________
webobjects-dev mailing list | email@hidden
Help/Unsubscribe/Archives: http://www.lists.apple.com/mailman/listinfo/webobjects-dev
Do not post admin requests to the list. They will be ignored.

  • Prev by Date: Re: RuleEditor, doesn't rule, ok!
  • Next by Date: RE: Problem using WOimage
  • Previous by thread: Re: Problem using WOimage
  • Next by thread: RE: Problem using WOimage
  • Index(es):
    • Date
    • Thread