Wrong size while open PS and EPS files using GflAx - ASP

Discussions on GFL SDK, the graphic library for reading and writing graphic files

Moderators: helmut, XnTriq, xnview

Guest

Wrong size while open PS and EPS files using GflAx - ASP

Post by Guest »

Hi, i am trying to manage my personal image files, which there are many formats; eps, ps, tiff....
So far there is little problem in opening the other formats but in PS and EPS

I cannot get the full image. As the GflAx open the files based on the definite width and length while opening them.

What I had done,
I had load the original image into the "server" using aspupload
then I resize it into the original size as jpeg, half size (mid) and thumbnail(quarter).
I had wanted to use the width and height to open the image in full but
this dimension used the one I had defined.

If the epswidth and epsheight set is too large the image is loaded but become very small. If they are set too small, then the image is not
fully load.

I therefore used the size (MB) to determine the size but it does not give an acurate one.

Below is my code.

Thank you.

Code: Select all

												
	UpFile.SaveAsVirtual strOriginalFile	'save the original file into my 
							      'server using aspupload
													
	'treating format GflAx cannot open
	if strFileExt =  ".ind" then		
		strFileName = "indd.tif"		
	else							
		if strFileExt =  ".ai" then	
			strFileName = "ai.tif"	
		else								
			if left(strFileExt,3) = ".fh" then	
				strFileName = "fh.tif"	
			end if	
		end if	
	end if		
										
										
	'GflAx setup and the server folder
																	PathO		= Server.MapPath("/ImgOriginal")	
		PathA		= Server.MapPath("/ImgActual")	
		PathM		= Server.MapPath("/ImgMid")		
		PathT		= Server.MapPath("/ImgThumb")		
						
		strOriginalFile	=	PathO & "/" & "Original_" & strFileName	
									
		strMidFile	= PathM & "/" & "Mid_" & ctrlFileID	
		strThumbFile = PathT & "/" & "Thumb_" & ctrlFileID	
		strActualFile  = PathA & "/" & "Actual_" & ctrlFileID	
										
	'/GflAx setup	
																			
	'load the file to check the dpi n size for eps or ps file	
																		
		if strFileExt = ".eps" or strFileExt = ".ps" then	
							
			Set GflAxObjChk	= server.createobject("GflAx.GflAx")	
																		GflAxObjChk.epsWidth	=3000
				GflAxObjChk.epsHeight	=3000
				GflAxObjChk.epsDpi	= 60		
				GflAxObjChk.EnableLZW	= True
								
				GflAxObjChk.LoadBitmap strOriginalFile	
				
				strPixLoadWidth	= GflAxObjChk.Width		
				strPixLoadHeight	= GflAxObjChk.Height	
				strPixXdpi	= GflAxObjChk.Xdpi			
				strPixYdpi	= GflAxObjChk.Ydpi			
				strPixByte	= GflAxObjChk.OriginalSize	
				' the width and height does not help to extract the 	
				'actual image dimension								
			Set GflAxObjChk	= nothing	
										
		end if	
					
		'/load the file to check the dpi n size for eps or ps file	
										
																	
		'Actual GflAxObj loading reSize and Save Image	
					
			Set GflAxObj	= server.createobject("GflAx.GflAx")	
											
			with GflAxObj	
						
			if strFileExt = ".eps" or strFileExt = ".ps" then	
			if strPixByte < 1000000  and strFileExt = ".eps" then	
				.epsWidth	= 500		
				.epsHeight	= 500	
				.epsDpi		= 60		
			else												
			if strPixByte < 10000000 and strFileExt = ".eps" then	
				.epsWidth	= 1500		
				.epsHeight	= 1500	
				.epsDpi		= 60		
			else											
			if strPixByte > 100000000 and strFileExt = ".eps" then	
				.epsWidth	= 3000		
				.epsHeight	= 3000	
				.epsDpi		= 60		
			else															if strPixByte < 1000000  and strFileExt = ".ps" then						.epsWidth	= 1500		
				.epsHeight	= 1500	
				.epsDpi		= 60		
			else															if strPixByte < 10000000 and strFileExt = ".ps" then						.epsWidth	= 2500		
				.epsHeight	= 2500	
				.epsDpi		= 60		
			else															if strPixByte > 100000000 and strFileExt = ".eps" then						.epsWidth	= 3000		
				.epsHeight	= 3000	
				.epsDpi		= 60		
			end if		
		end if		
		end if		
		end if		
		end if		
		end if		
		end if	
																	.EnableLZW	= True	
		.LoadBitmap strOriginalFile	
													
		strImgWidth	= .Width	
		strImgHeight	= .Height		
		'strImgByte	= .OriginalSize
																											
if strFileExt =  ".ind" or strFileExt =  ".ai" or left(strFileExt,3) = ".fh" then	
	strMImgWidth	= strImgWidth	
	strMImgHeight	= strImgHeight	
else							
strMImgWidth	= strImgWidth/2	
strMImgHeight	= strImgHeight/2	
end if	
										
																											
if strFileExt =  ".ind" or strFileExt =  ".ai" or left(strFileExt,3) = ".fh" then	
	strTImgWidth	= strImgWidth	
	strTImgHeight	= strImgHeight	
else							
	if strImgByte < 1000000 then			
		strTImgWidth	= strImgWidth/2	
		strTImgHeight	= strImgHeight/2	
	else								
		strTImgWidth	= strImgWidth/4	
		strTImgHeight	= strImgHeight/4	
	end if		
end if	
														
.SaveFormat = 1			
.SaveFormatName = "jpeg"		
.SaveJPEGProgressive = True	
.SaveJPEGQuality = 70 		
.SaveBitmap(strActualFile)	
			
.Resize strMImgWidth, strMImgHeight
.SaveFormat = 1			
.SaveFormatName = "jpeg"		
.SaveJPEGProgressive = True	
.SaveJPEGQuality = 70 		
.SaveBitmap(strMidFile)		
	
.Resize strMImgWidth, strMImgHeight
.SaveFormat = 1			
.SaveFormatName = "jpeg"		
.SaveJPEGProgressive = True	
.SaveJPEGQuality = 70 		
.SaveBitmap(strThumbFile)	
											
end with	
													
set GFlAxObj	= nothing	
																	
'/Actual GflAxObj loading reSize and Save Image	
										
[/code]
User avatar
xnview
Author of XnView
Posts: 45870
Joined: Mon Oct 13, 2003 7:31 am
Location: France

Re: Wrong size while open PS and EPS files using GflAx - ASP

Post by xnview »

Guest wrote:Hi, i am trying to manage my personal image files, which there are many formats; eps, ps, tiff....
So far there is little problem in opening the other formats but in PS and EPS

I cannot get the full image. As the GflAx open the files based on the definite width and length while opening them.

What I had done,
I had load the original image into the "server" using aspupload
then I resize it into the original size as jpeg, half size (mid) and thumbnail(quarter).
I had wanted to use the width and height to open the image in full but
this dimension used the one I had defined.

If the epswidth and epsheight set is too large the image is loaded but become very small. If they are set too small, then the image is not
fully load.
Is it possible to have a link to your EPS/PS file?
Pierre.