| 
			
			 | 
		#1 | 
| 
			
			
			
			 Addict 
			
			![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() Posts: 351 
				Karma: 70000 
				Join Date: Jul 2010 
				Location: Australia 
				
				
				Device: ADE, iPad 
				
				
				 | 
	
	
	
		
		
			
			 
				
				cleaning the content.opf file
			 
			
			
			Hi Guys,  
		
	
		
		
		
		
		
		
		
		
		
		
	
	I'm having alot of: "content.opf(67): duplicate resource:" errors, after creating an epub from InDesign CS3 I can manually delete this image references which fix the problem, but there could be 1000 of them... here is a screen grab...I've put red dots next to the line that the shouldn't be there... So for every image in the job it InDesign will duplicate it for every xhtml and so... eg If you have 10 xhtml files each with 10 images then those 100 image would be duplicated 10 times and throw up that error message.... It's taking forever to clean them up. There must be an easier way?  
		 | 
| 
		 | 
	
	
	
		
		
		
		
			 
		
		
		
		
		
		
		
			
		
		
		
	 | 
| 
			
			 | 
		#2 | 
| 
			
			
			
			 Wizard 
			
			![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() Posts: 1,196 
				Karma: 1281258 
				Join Date: Sep 2009 
				
				
				
				Device: PRS-505 
				
				
				 | 
	
	
	
		
		
		
		
		 
			
			Open the .opf in Notepad++ and use a regular expression to replace the erroneous lines with a blank. 
		
	
		
		
		
		
		
		
		
		
		
		
	
	I'm guessing that you have 2 images in each chapter, and they're all linked to the same sources on disk. If you want to avoid having to clean up the opf and can accept a bit of bloat in your epub, then a solution might be to create copies of the images with distinct names for each chapter and link to those in your source documents. I never used CS3 to create epubs, but I do know a lot of people complained about how buggy its epub export filter was. Unfortunately, even CS5 fails to address this issue properly and creates a copy of each repeated image rather than simply linking to a single version.  | 
| 
		 | 
	
	
	
		
		
		
		
			 
		
		
		
		
		
		
		
			
		
		
		
	 | 
| Advert | |
| 
         | 
    
| 
			
			 | 
		#3 | 
| 
			
			
			
			 Addict 
			
			![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() Posts: 351 
				Karma: 70000 
				Join Date: Jul 2010 
				Location: Australia 
				
				
				Device: ADE, iPad 
				
				
				 | 
	
	
	
		
		
		
		
		 
			
			Nuts... I was hoping CS5 (which is in trasit) would have this problem fixed. 
		
	
		
		
		
		
		
		
		
		
		
		
		
			I was hoping someone would have made a script or something which would at least get it to a point of Validating (epubcheck+kindleGen). Yeah, I've been using ^.*-jpeg-.*$ to clean up the lines... But so time consuming... Last edited by Adjust; 07-28-2010 at 10:10 PM.  | 
| 
		 | 
	
	
	
		
		
		
		
			 
		
		
		
		
		
		
		
			
		
		
		
	 | 
| 
			
			 | 
		#4 | 
| 
			
			
			
			 frumious Bandersnatch 
			
			![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() Posts: 7,570 
				Karma: 20150435 
				Join Date: Jan 2008 
				Location: Spaniard in Sweden 
				
				
				Device: Cybook Orizon, Kobo Aura 
				
				
				 | 
	
	
	
		
		
		
		
		 
			
			I guess it could be added to the "ePUB fix" plugins in Calibre.
		 
		
	
		
		
		
		
		
		
		
		
		
		
	
	 | 
| 
		 | 
	
	
	
		
		
		
		
			 
		
		
		
		
		
		
		
			
		
		
		
	 | 
| 
			
			 | 
		#5 | 
| 
			
			
			
			 Addict 
			
			![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() Posts: 351 
				Karma: 70000 
				Join Date: Jul 2010 
				Location: Australia 
				
				
				Device: ADE, iPad 
				
				
				 | 
	
	|
| 
		 | 
	
	
	
		
		
		
		
			 
		
		
		
		
		
		
		
			
		
		
		
	 | 
| Advert | |
| 
         | 
    
| 
			
			 | 
		#6 | 
| 
			
			
			
			 Junior Member 
			
			![]() Posts: 9 
				Karma: 10 
				Join Date: Aug 2010 
				
				
				
				Device: iPhone 
				
				
				 | 
	
	
	
		
		
		
		
		 
			
			does the ePub fix actually do anything?
		 
		
	
		
		
		
		
		
		
		
		
		
		
	
	 | 
| 
		 | 
	
	
	
		
		
		
		
			 
		
		
		
		
		
		
		
			
		
		
		
	 | 
| 
			
			 | 
		#7 | 
| 
			
			
			
			 Addict 
			
			![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() Posts: 351 
				Karma: 70000 
				Join Date: Jul 2010 
				Location: Australia 
				
				
				Device: ADE, iPad 
				
				
				 | 
	
	
	
		
		
		
		
		 
			
			I don't think it's being added... 
		
	
		
		
		
		
		
		
		
		
		
		
	
	It turns out InDesign CS5 fixes most of these issues. Not sure about CS4 though  | 
| 
		 | 
	
	
	
		
		
		
		
			 
		
		
		
		
		
		
		
			
		
		
		
	 | 
![]()  | 
            
        
    
            
  | 
    
			 
			Similar Threads
		 | 
	||||
| Thread | Thread Starter | Forum | Replies | Last Post | 
| [Old Thread] What's an OPF file? | Anarel | Calibre | 8 | 03-28-2016 06:17 PM | 
| [Old Thread] calibre not creating content.opf or toc.ncx files during conversion | foxxywith2xs | Calibre | 7 | 12-16-2012 08:49 PM | 
| Default book language to be saved in content.opf? | moriakaice | Calibre | 7 | 05-21-2011 06:02 PM | 
| HTML to Mobi conversions (DocBook XSL, and content.opf?) | AndrewLB | Calibre | 3 | 09-04-2010 10:02 PM | 
| Newbie to editing opf file | pda_junkie | Workshop | 2 | 05-08-2010 10:58 AM |