DEVTOOLS: BLADERUNNER: Abort on unsupported optimization of PNG input
Also revert the sample pngs to the non-optimized versions.
|
@ -102,7 +102,7 @@ else:
|
||||||
structLibFound = True
|
structLibFound = True
|
||||||
|
|
||||||
try:
|
try:
|
||||||
from PIL import Image
|
from PIL import Image
|
||||||
except ImportError:
|
except ImportError:
|
||||||
print "[Error] Image python library (PIL) is required to be installed!"
|
print "[Error] Image python library (PIL) is required to be installed!"
|
||||||
else:
|
else:
|
||||||
|
@ -129,7 +129,7 @@ from struct import *
|
||||||
from fonFileLib import *
|
from fonFileLib import *
|
||||||
|
|
||||||
COMPANY_EMAIL = "classic.adventures.in.greek@gmail.com"
|
COMPANY_EMAIL = "classic.adventures.in.greek@gmail.com"
|
||||||
APP_VERSION = "1.00"
|
APP_VERSION = "1.10"
|
||||||
APP_NAME = "grabberFromPNGHHBR"
|
APP_NAME = "grabberFromPNGHHBR"
|
||||||
APP_WRAPPER_NAME = "fontCreator.py"
|
APP_WRAPPER_NAME = "fontCreator.py"
|
||||||
APP_NAME_SPACED = "Blade Runner Font Creator/Exporter"
|
APP_NAME_SPACED = "Blade Runner Font Creator/Exporter"
|
||||||
|
@ -484,6 +484,11 @@ class grabberFromPNG:
|
||||||
if startCol != 0:
|
if startCol != 0:
|
||||||
break
|
break
|
||||||
for y in range(0, imheight): # we search all rows (for each column)
|
for y in range(0, imheight): # we search all rows (for each column)
|
||||||
|
if type(loadedImag[x, y]) is not tuple or len(loadedImag[x, y]) < 4:
|
||||||
|
#print type(loadedImag[x, y]), len(loadedImag[x, y])
|
||||||
|
print "[Error] Bad format for pixel type -- probable cause: unsupported PNG optimization"
|
||||||
|
return -2
|
||||||
|
|
||||||
r1,g1,b1,a1 = loadedImag[x, y]
|
r1,g1,b1,a1 = loadedImag[x, y]
|
||||||
if a1 != 0: # if pixel not completely transparent -- this is not necessarily the *top* left pixel of a font letter though! -- the startRow is still to be determined.
|
if a1 != 0: # if pixel not completely transparent -- this is not necessarily the *top* left pixel of a font letter though! -- the startRow is still to be determined.
|
||||||
#if gTraceModeEnabled:
|
#if gTraceModeEnabled:
|
||||||
|
@ -646,8 +651,8 @@ class grabberFromPNG:
|
||||||
errorFound = True
|
errorFound = True
|
||||||
if not errorFound:
|
if not errorFound:
|
||||||
#debug
|
#debug
|
||||||
#if gTraceModeEnabled:
|
if gTraceModeEnabled:
|
||||||
# print "[Debug] ", self.imageRowFilePNG, im.format, "%dx%d" % im.size, im.mode
|
print "[Debug] ", self.imageRowFilePNG, im.format, "%dx%d" % im.size, im.mode
|
||||||
w1, h1 = im.size
|
w1, h1 = im.size
|
||||||
trimTopPixels = 0
|
trimTopPixels = 0
|
||||||
trimBottomPixels = 0
|
trimBottomPixels = 0
|
||||||
|
|
Before Width: | Height: | Size: 870 B After Width: | Height: | Size: 1.5 KiB |
Before Width: | Height: | Size: 14 KiB After Width: | Height: | Size: 27 KiB |
Before Width: | Height: | Size: 12 KiB After Width: | Height: | Size: 23 KiB |
Before Width: | Height: | Size: 17 KiB After Width: | Height: | Size: 33 KiB |
Before Width: | Height: | Size: 17 KiB After Width: | Height: | Size: 26 KiB |
Before Width: | Height: | Size: 17 KiB After Width: | Height: | Size: 26 KiB |
|
@ -125,12 +125,14 @@ void Subtitles::init(void) {
|
||||||
// Loading subtitles versioning info if available
|
// Loading subtitles versioning info if available
|
||||||
TextResource versionTxtResource(_vm);
|
TextResource versionTxtResource(_vm);
|
||||||
if ( versionTxtResource.open(SUBTITLES_VERSION_TRENAME, false)) {
|
if ( versionTxtResource.open(SUBTITLES_VERSION_TRENAME, false)) {
|
||||||
_subtitlesInfo.credits = versionTxtResource.getText((uint32)0);
|
_subtitlesInfo.credits = versionTxtResource.getText((uint32)0);
|
||||||
_subtitlesInfo.versionStr = versionTxtResource.getText((uint32)1);
|
_subtitlesInfo.versionStr = versionTxtResource.getText((uint32)1);
|
||||||
_subtitlesInfo.dateOfCompile = versionTxtResource.getText((uint32)2);
|
_subtitlesInfo.dateOfCompile = versionTxtResource.getText((uint32)2);
|
||||||
_subtitlesInfo.languageMode = versionTxtResource.getText((uint32)3);
|
_subtitlesInfo.languageMode = versionTxtResource.getText((uint32)3);
|
||||||
Common::String fontType = versionTxtResource.getText((uint32)4);
|
Common::String fontType = versionTxtResource.getText((uint32)4);
|
||||||
_subtitlesInfo.fontName = versionTxtResource.getText((uint32)5);
|
_subtitlesInfo.fontName = versionTxtResource.getText((uint32)5);
|
||||||
|
Common::String license = versionTxtResource.getText((uint32)6);
|
||||||
|
Common::String licenseLink = versionTxtResource.getText((uint32)7);
|
||||||
|
|
||||||
if (fontType.equalsIgnoreCase("ttf")) {
|
if (fontType.equalsIgnoreCase("ttf")) {
|
||||||
_subtitlesInfo.fontType = Subtitles::kSubtitlesFontTypeTTF;
|
_subtitlesInfo.fontType = Subtitles::kSubtitlesFontTypeTTF;
|
||||||
|
|