10-09-2010, 12:35 PM | #91 | |||
Addict
Posts: 326
Karma: 960
Join Date: Jul 2009
Location: Florida, US
Device: Kindle DX, iPad
|
Quote:
1) Keep the trimmed image and delete the untrimmed image 2) Delete the trimmed image and keep the untrimmed image based on the @trim_cancel value. In other words, Canti has no direct control over trimming, so it doesn't just say "trim x # of pixels". I would have to write my own trim algorithm to leave a trim buffer. Quote:
Quote:
... 3 mins 18 secs. The dual core cpu was running hard the whole time, but the only time ram starting filling up was while creating the pdf (and even then the ram usage increased by 800mb at most, so virtual memory was never used). You're on a netbook right? Maybe there is something weird with ImageMagick and netbooks. |
|||
10-09-2010, 03:46 PM | #92 |
Addict
Posts: 326
Karma: 960
Join Date: Jul 2009
Location: Florida, US
Device: Kindle DX, iPad
|
Here's Canti v1.92
New to verison 1.92: -Bug fix: Brain tweak Canti's brain had to be tweaked a bit. It wouldn't correctly determine that an output_folder archive needed restoring because a new output format (like .pdf) was requested by the user. -Set unrar and rar handlers in .properties file In previous versions of Canti, unrar/rar handlers were determined automatically at runtime. This can be a problem if Canti is unable to find unrar/rar handlers on your system even though they are there. The locations of unrar/rar handlers is now specified in the .properties file. When creating the .properties file, Canti will attempt to determine these values automatically. If it can't find one/both, the user can manually specify the values. Canti will still attempt to find unrar/rar handlers at runtime if the values in the .properties file are blank or inaccurate. This is set up in the .properties file. Enjoy and let me know if this works for you |
10-09-2010, 04:41 PM | #93 |
Connoisseur
Posts: 63
Karma: 194
Join Date: Feb 2010
Device: notebook
|
Getting close:
unrar handler: d:\winrar\ rar handler: d:\winrar\ Testing rar handler... Can unrar: true Can rar: true parent_folder D:\image1\ast.cbr is a rar/cbr, so running in single folder mode Restoring 1 image folders in parent_folder... java.io.IOException: Cannot run program "d:\winrar\": CreateProcess error=5 acess is denied |
10-09-2010, 05:13 PM | #94 | |
Addict
Posts: 326
Karma: 960
Join Date: Jul 2009
Location: Florida, US
Device: Kindle DX, iPad
|
Quote:
Code:
unrar_handler = C:\\Program Files\\WinRAR\\UnRAR.exe rar_handler = C:\\Program Files\\WinRAR\\Rar.exe |
|
10-09-2010, 06:29 PM | #95 |
Connoisseur
Posts: 63
Karma: 194
Join Date: Feb 2010
Device: notebook
|
Superb!
Now it is all working! Great job! You are a master! |
10-09-2010, 07:49 PM | #96 | |||
Fanatic
Posts: 556
Karma: 1102020
Join Date: Sep 2009
Device: Kindle Keyboard (rip), Kindle Voyage, Fire Tablet 10 '17, iPad '19
|
Quote:
Is there a way to make auto_rotate not rotate a page if it is undersized? See the attached before.jpg and after.jpg. The original size is 700x500. I have my device resolution set to 800x-1 so it should fit without change. But...
I have another page that is 1103x803. Ideally, it would be rotated and shrunked to something like 800x1100. But it got rotated and shrunked to 587x803 and had borders added to the sides to create a final 800x803 image. I disabled borders and the image is still shrunken. Again no difference if I change max_dpi between -1, 167, and 72. My settings with 1.92 Quote:
Quote:
This a laptop has a Core 2 Due 2.26Ghz, 2GB ram and Windows XP. I'm going to increase the page file from 2GB to 3GB to see if that helps. How can I have canti skip the final PDF output step? What are the convert.exe parameters to create the final pdf from the processed images? I want to see if I can run convert.exe outside of canti but using the same parameters to see what happens. In other news, I've made a batch file that makes it possible to invoke canti by dragging a folder or comic file onto a script file, avoiding the need to open a command prompt. Open notepad, paste the following, and save as something like run.cmd in the canti folder. Code:
@echo off set parent_folder=%~1 set title=%~n1 set app_folder=%~dp0 set output_folder=%~dp0%~n1\ set parent_folder=%parent_folder:\=\\% set output_folder=%output_folder:\=\\% echo - Parameters ---------------- echo app_folder=%app_folder% echo parent_folder=%parent_folder% echo title=%title% echo output_folder=%output_folder% echo. echo - To Run ---------------- set to_run=java -jar canti.jar -parent_folder "%parent_folder%" -title "%title%" -output_folder "%output_folder%" echo %to_run% echo. pause cd "%app_folder%" %to_run% pause Last edited by badbob001; 10-09-2010 at 07:51 PM. |
|||
10-10-2010, 09:11 AM | #97 | |||
Addict
Posts: 326
Karma: 960
Join Date: Jul 2009
Location: Florida, US
Device: Kindle DX, iPad
|
Quote:
I'm also thinking about writing my own trim algorithm. I already have some pixel interpretation code from the auto split landscape scans feature, but I'm pretty sure it wouldn't be able to handle as many input image formats as ImageMagick. I can always program it and see how it goes. Quote:
Code:
convert *.jpg out.pdf Quote:
-Edit- I think I fixed both the ImageMagick trimming non-white space and weird output sizes when specifying one dimensional resize. I pm'ed you the code and if all is fixed I will post the update. Last edited by lilman; 10-10-2010 at 05:46 PM. |
|||
10-11-2010, 10:01 AM | #98 |
Fanatic
Posts: 556
Karma: 1102020
Join Date: Sep 2009
Device: Kindle Keyboard (rip), Kindle Voyage, Fire Tablet 10 '17, iPad '19
|
Here is an update of my drag-drop script for canti.
It looks like if canti.jar is on a unc path, canti ignores the canti.properties file in the same location but looks for it in the user's profile folder. This applies as well when canti creates the properties files. I've resolved this by forcing canti to look in its current location with the -properties parameter. Code:
@echo off echo Script start... set jar=canti.jar set prop=canti.properties if !%1!==!! goto:usage set parent_folder=%1 set title="%~n1" set current_folder="%~dp0" set jar="%~dp0%jar%" set prop="%~dp0%prop%" set output_folder="%~dp0%~n1\" set parent_folder=%parent_folder:\=\\% set output_folder=%output_folder:\=\\% :prop_check if exist %prop% goto:prop_ok echo - Setup ---------------- echo * Canti.Properties file does not exist. Please type in the device you have from the following list: echo default, kdx, k2, ipad, nook, prs-900, prs-700, prs-600, prs-505, prs-500, prs-300, iliad, dr800, dr1000, jb, jbl echo. :prop_setup set /p device=Your Device: if !%device%!==!! goto:prop_setup java -jar %jar% -create_properties %device% if exist "%userprofile%\canti.properties" move /y "%userprofile%\canti.properties" %current_folder% goto:prop_check :prop_ok set prop=%prop:\=\\% echo - Parameters ---------------- echo * jar=%jar% echo * prop=%prop% echo * parent_folder=%parent_folder% echo * title=%title% echo * output_folder=%output_folder% echo. echo - To Run ---------------- set to_run=java -jar %jar% -properties %prop% -parent_folder %parent_folder% -title %title% -output_folder %output_folder% echo %to_run% echo. pause %to_run% goto:end :usage echo * Usage: Drag folder or archive onto script. goto:end :end echo ...Script end. pause Last edited by badbob001; 10-11-2010 at 02:25 PM. Reason: Removed quotes causing canti.properties to not be found. |
10-11-2010, 11:30 AM | #99 |
Addict
Posts: 326
Karma: 960
Join Date: Jul 2009
Location: Florida, US
Device: Kindle DX, iPad
|
Here's Canti v1.92a
New to version 1.92a: -Bug fix: Auto trimming not working properly The auto trim algorithm was only supposed to be trimming the white space around a scan, but if there was another dominant color on the outside of the scan (such as black) it would trim that instead. Now instead of trimming a random color, auto trimming will trim whatever color you specify in @trim_color. -Bug fix: Resizing only width or height would produce weird sized output If you disabled either width or height resizing (so you set one of them to some integer > 0, and the other to -1) then the output images could come out at a size you didn't expect. Resizing one dimension should work correctly now. -Trim color If you enabled auto trimming, this is the color that should be trimmed. If you set this value to original, then the trimming algorithm will trim whatever color it encounters first. Acceptable values: original, white, black, #[hex color code] (for example: #000000) Recommended: white This is set up in the .properties file. Enjoy |
10-12-2010, 10:32 AM | #100 |
Fanatic
Posts: 556
Karma: 1102020
Join Date: Sep 2009
Device: Kindle Keyboard (rip), Kindle Voyage, Fire Tablet 10 '17, iPad '19
|
It seems that trying to match the resolution of the Kindle is a bit of a wasted effort due to the Kindle's PDF viewer lacking a full screen mode and forced margins. I wonder if the zero-margin hack + the mobi format would yield better results, but I think the mobi viewer will always scale an image to fit the screen.
|
10-12-2010, 06:59 PM | #101 | |
Addict
Posts: 326
Karma: 960
Join Date: Jul 2009
Location: Florida, US
Device: Kindle DX, iPad
|
Quote:
|
|
10-13-2010, 05:02 AM | #102 |
Connoisseur
Posts: 63
Karma: 194
Join Date: Feb 2010
Device: notebook
|
I currently use
width = 750 height = 1000 so If I read in landscape mode, the fit size is very close to actual size, so the text is very readable (almost the same as if I choose actual size) There is one think on K3 I do not understand, If I choose actual size, pressing next page puts me directly to next page, but If I leave default (fit page), pressing next page puts me to second half of the page. So that is why I use this setting to use default setting. Last edited by jozicka; 10-13-2010 at 05:06 AM. |
10-13-2010, 12:52 PM | #103 | |
Fanatic
Posts: 556
Karma: 1102020
Join Date: Sep 2009
Device: Kindle Keyboard (rip), Kindle Voyage, Fire Tablet 10 '17, iPad '19
|
Not one canti configuration matches all my conversion needs and so I've updated my script to support multiple configuration files:
If Canti.properties is:
The above list is ordered so the first found properties file takes priority over the ones below. The following may be insulting to the intelligence of the forum members, but what the hell. Quote:
Other changes:
Code:
@echo off echo Script start... set jar=canti.jar set prop=Canti.properties if !%1!==!! goto:usage set parent_folder="%~1" set title="%~n1" set current_folder="%~dp0" set jar="%~dp0%jar%" set output_folder="%~dp0%~n1\" :prop_check if exist "%~1\%prop%" set prop="%~1\%prop%"& echo * Found Canti.properties in source subfolder& goto:prop_ok if exist "%~1\..\%prop%" set prop="%~1\..\%prop%"& echo * Found Canti.properties in source folder& goto:prop_ok if exist "%~dp0%prop%" set prop="%~dp0%prop%"& echo * Found Canti.properties in current folder& goto:prop_ok echo - Setup ---------------- echo * Canti.Properties file does not exist. Please type in the device you have from the following list: java -jar %jar% | find "Acceptable [device_name]" echo. :prop_setup set /p device=Your Device: if !%device%!==!! goto:prop_setup java -jar %jar% -create_properties %device% if exist "%userprofile%\canti.properties" echo Moving canti.properties file to current folder& move /y "%userprofile%\canti.properties" %current_folder% goto:prop_check :prop_ok set prop=%prop:\=\\% set parent_folder=%parent_folder:\=\\% set output_folder=%output_folder:\=\\% echo - Parameters ---------------- echo * jar=%jar% echo * prop=%prop% echo * parent_folder=%parent_folder% echo * title=%title% echo * output_folder=%output_folder% echo. echo - To Run ---------------- set to_run=java -jar %jar% -properties %prop% -parent_folder %parent_folder% -title %title% -output_folder %output_folder% echo %to_run% echo. pause %to_run% goto:end :usage echo * Usage: Drag a single folder or archive onto script. goto:end :end echo ...Script end. pause |
|
10-13-2010, 04:37 PM | #104 | |
Fanatic
Posts: 556
Karma: 1102020
Join Date: Sep 2009
Device: Kindle Keyboard (rip), Kindle Voyage, Fire Tablet 10 '17, iPad '19
|
Quote:
The reality is that actual size (100%) blows up the image way too big and there should be an option to have the page buttons move the view window in a zigzag motion to scan all parts of the page. And to add to the confusion, when zooming, the zoom window doesn't accurately represent what is going to be displayed. There is also a bug in portrait where the zoom window on the first page is at about 66% of the screen while later pages has it at 25%. Anyone figure out a PDF setting (resolution, dpi, etc) where Actual Size makes the page match the size of the display? Playing with the density and unit setting with convert.exe, a setting of 300 is close to the actual size but there are still scrollbars. I also tried just copying the image files straight to the kindle and the images can be viewed fullscreen and the last accessed page is remembered. There is the occasional ghost artifact from previous pages and an annoyance with it saying it's full screen but the title bar is still there. I'm going to try this and if it's okay, I may go this route. I suppose I could had used mangle but canti supports splitting landscape pages (thanks!) and supports converting whole folders of content at a time. Mangle outputs to gif so I'm wondering if I may get better and cleaner results setting canti to gif as well (gif is cleaner than jpg for high contrast line-oriented images). |
|
10-15-2010, 07:01 PM | #105 |
Fanatic
Posts: 556
Karma: 1102020
Join Date: Sep 2009
Device: Kindle Keyboard (rip), Kindle Voyage, Fire Tablet 10 '17, iPad '19
|
It seems like there are some strange bugs when the output is set to GIF. And some minor bugs with landscape pages when border=true and rotate=false.
The following chart may help explain what is happening (I need to use my free time more wisely : The input are a portrait and a landscape page from the web comic Octopus Pie. If you want to see the actual input and output images and properties files, see the attached zip. It looks like some sort of extra black border is being applied to the GIF images to cause them to be bigger than the target size. Another major thing is that the created GIFs are unreadable on my Kindle but are okay on my PC. When I simply ran "convert.exe 0000.png 0000.gif", that gif views fine on the Kindle so it must be some extra steps in Canti causing the problem. Progressive gif? Another thing is that the generated xxxxx.manga_save file always specifies the filename extension as .PNG, despite the output in canti set for .JPG or .GIF. Is this expected? It seems to cause a strange bug on the Kindle where trying to view the gif makes it show the last screen saver image. Buffer overflow? |
|
Similar Threads | ||||
Thread | Thread Starter | Forum | Replies | Last Post |
Canti: Manga Processing Program | lilman | Workshop | 42 | 04-14-2011 06:52 PM |
Canti: Manga Processing Program | lilman | Apple Devices | 55 | 04-14-2011 05:50 PM |
Classic Canti: Manga Processing Program | lilman | Barnes & Noble NOOK | 4 | 07-14-2010 04:45 PM |
Canti: Manga Processing Program | lilman | Sony Reader Dev Corner | 1 | 07-14-2010 04:43 PM |
Best for manga | eqzitara | Which one should I buy? | 27 | 11-19-2007 07:58 AM |