User Tag List

Page 2 of 3 FirstFirst 1 2 3 LastLast
Results 11 to 20 of 27

Thread: ExportImage bug

  1. #11
    Forum Moderator Fusion 2.5 DeveloperAndroid Export ModuleHTML5 Export ModuleiOS Export ModuleSWF Export ModuleXNA Export Module
    Sphax's Avatar
    Join Date
    Jun 2006
    Location
    Paris, France
    Posts
    4,454
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    Re: ExportImage bug

    I've found a new bug in the this overlay :
    - when pasting a rotated active object in overlay, the active is pasted at original angle.
    - the image pasted of the active object has a column of pixel which is left near the right)...

  2. #12
    No Products Registered

    Join Date
    Jun 2006
    Location
    Texas
    Posts
    1,002
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    Re: ExportImage bug

    I just spent 3 hours trying to work around the Export Image bug with no luck. Anything I try only allows me to save to like 2 filters or so.

    Overlay development is on hold until this is fixed.

  3. #13
    Clickteam Clickteam

    Join Date
    Jun 2006
    Location
    France
    Posts
    13,076
    Mentioned
    119 Post(s)
    Tagged
    2 Thread(s)

    Re: ExportImage bug

    Err... can't you just compare the image filter and then create a surface without alpha channel if it's JPEG? Sounds easy... what's the problem?

  4. #14
    No Products Registered

    Join Date
    Jun 2006
    Location
    Texas
    Posts
    1,002
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    Re: ExportImage bug

    I tried and it doesn't work. Sometimes the image doesn't even save without alpha channel attached.

    There is definately some sort of problem with ExportImage and I can't release Overlay until it is fixed.

    This is the code:

    Code:
    short WINAPI DLLExport actSaveImage(LPRDATA rdPtr, long param1, long param2)
    {
    	fprh	rhPtr = rdPtr->rHo.hoAdRunHeader;
    	CImageFilterMgr* pImgMgr = rhPtr->rh4.rh4Mv->mvImgFilterMgr;
    	DWORD mFilter=NULL;
    	//pImgMgr=pImgMgr->CreateInstance();
    #if defined(VITALIZE)
    	return 0;
    #else
    	if(rdPtr->runSurface!= NULL)
    	{
    		mFilter=FindFilter(rdPtr,pImgMgr,(LPCSTR)param1);
    
    		if(!ExportImage(pImgMgr,(LPCSTR)param1,rdPtr->runSurface,mFilter))
    		{
    			LPSURFACE pProto = NULL;
    			int depth=24;
    			CImageFilter pFilter(pImgMgr);
    			pFilter.UseSpecificFilterID(mFilter);
    
    			if ( GetSurfacePrototype(&pProto, depth, ST_MEMORYWITHDC, SD_DIB) )
    			{
    				// OK
    				cSurface * wNA = new cSurface();
    				if (wNA!= NULL)
    				{
    					wNA->Create(rdPtr->swidth,rdPtr->sheight,pProto);
    					rdPtr->runSurface->Blit(*wNA,0,0,BMODE_OPAQUE,BOP_COPY,0);
    					ExportImage(pImgMgr,(LPCSTR)param1,wNA,mFilter);
    					delete wNA;
    				}
    
    			}
    		}
    	}
    
    	return 0;
    #endif
    }
    I can always save to PNG files, I can save to JPEG files, I can't save to GIF files and I can't save to JPG files. I also can't save to BMP files.

    Here is the code to FindFilter:

    Code:
    DWORD FindFilter(LPRDATA rdPtr,CImageFilterMgr *pImgMgr,LPCSTR filepath)
    {
    	std::string FileStr=filepath;
    	std::string::size_type findex = std::string::npos;
    	int index=-1;
    	int bmpindex=0;
    	findex=FileStr.find_last_of('.')+1;
    	for(int i=0;i<pImgMgr->GetFilterCount();i++)
    	{
    		if(pImgMgr->DoesFilterSupportImages(i))
    		{
    			LPCSTR*mFileExts=pImgMgr->GetFilterExts(i);
    			LPCSTR ExtStr=NULL;
    			ExtStr=(*mFileExts++);
    			while(ExtStr!=NULL)
    			{
    				if(std::string(ExtStr)==std::string("bmp"))
    					bmpindex=i;
    				if(FileStr.substr(findex)==std::string(ExtStr))
    				{
    					index=i;
    					break;
    				}
    				ExtStr=(*mFileExts++);
    			}
    			if(index!=-1)
    				break;
    		}
    	}
    	if(index==-1)
    		index=bmpindex;
    	return pImgMgr->GetFilterID(index);
    }
    I have tested the FindFilter function and it works without flaw. It is the ExportImage function that is the problem .

  5. #15
    Clickteam Clickteam

    Join Date
    Jun 2006
    Location
    France
    Posts
    13,076
    Mentioned
    119 Post(s)
    Tagged
    2 Thread(s)

    Re: ExportImage bug

    OK, I'll take a look at the code.

    I can't save to GIF files
    Yes, the GIF and TGA filters can't save pictures. The Export feature is implemented only in the PNG, JPEG and BMP filters.

  6. #16
    No Products Registered

    Join Date
    Jun 2006
    Location
    Texas
    Posts
    1,002
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    Re: ExportImage bug

    Eh why? Also why not add a function "DoesFilterSupportImageExport" or something so we can tell which filters will even allow for export?

    If I had access to the filter SDK then I could develop a DevIL SDK that could support a ton of image formats with import and export.

  7. #17
    Clickteam Clickteam

    Join Date
    Jun 2006
    Location
    France
    Posts
    13,076
    Mentioned
    119 Post(s)
    Tagged
    2 Thread(s)

    Re: ExportImage bug

    Time problem maybe as the TGA and GIF filters use my own routines while PNG and JPEG use standard libraries where Save is implemented.

  8. #18
    No Products Registered

    Join Date
    Jun 2006
    Location
    Texas
    Posts
    1,002
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    Re: ExportImage bug

    Just use DevIL then .

  9. #19
    Clickteam Clickteam

    Join Date
    Jun 2006
    Location
    France
    Posts
    13,076
    Mentioned
    119 Post(s)
    Tagged
    2 Thread(s)

    Re: ExportImage bug

    THere is a CanSave function in the CImageFilter class.

  10. #20
    No Products Registered

    Join Date
    Jun 2006
    Location
    Texas
    Posts
    1,002
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    Re: ExportImage bug

    Ah. I guess DevIL won't work like I thought anyway, apparently they want you to release the source to it . I guess that isn't a concern when you are making freeware.

    EDIT: Anyway I hope this can be fixed soon.

    Good Luck and thanks for the help .

Page 2 of 3 FirstFirst 1 2 3 LastLast

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •