找回密码
 立即注册

QQ登录

只需一步,快速开始

查看: 14749|回复: 4

[已解决] 询问,为什么有的图片在打包后就显示couldn't find

[复制链接]
发表于 2021-3-15 12:41:31 | 显示全部楼层 |阅读模式

马上注册,结交更多好友,享用更多功能,让你轻松玩转社区。

您需要 登录 才可以下载或查看,没有账号?立即注册

×
本帖最后由 wataryuu 于 2021-5-24 08:11 编辑

把制作了个序章的demo打包后测试时发现的问题。
其他图片显示都正常,但是人物有关(立绘和头像)的两张图片(和其他图片都在同一个文件夹里)打包为rpa后进行测试时,都显示以下错误:

  1. I'm sorry, but an uncaught exception occurred.

  2. While loading <'Image' u'sakiei01.png '>:
  3. IOError: Couldn't find file 'sakiei01.png '.

  4. -- Full Traceback ------------------------------------------------------------

  5. Full traceback:
  6.   File "rpy/the0.rpyc", line 64, in script
  7.   File "renpy/ast.py", line 715, in execute
  8.     renpy.exports.say(who, what, *args, **kwargs)
  9.   File "renpy/exports.py", line 1384, in say
  10.     who(what, *args, **kwargs)
  11.   File "renpy/character.py", line 1179, in __call__
  12.     self.do_display(who, what, cb_args=self.cb_args, dtt=dtt, **display_args)
  13.   File "renpy/character.py", line 851, in do_display
  14.     **display_args)
  15.   File "renpy/character.py", line 601, in display_say
  16.     rv = renpy.ui.interact(mouse='say', type=type, roll_forward=roll_forward)
  17.   File "renpy/ui.py", line 298, in interact
  18.     rv = renpy.game.interface.interact(roll_forward=roll_forward, **kwargs)
  19.   File "renpy/display/core.py", line 3007, in interact
  20.     repeat, rv = self.interact_core(preloads=preloads, trans_pause=trans_pause, pause=pause, pause_start=pause_start, **kwargs)
  21.   File "renpy/display/core.py", line 3517, in interact_core
  22.     self.draw_screen(root_widget, fullscreen_video, (not fullscreen_video) or video_frame_drawn)
  23.   File "renpy/display/core.py", line 2377, in draw_screen
  24.     renpy.config.screen_height,
  25.   File "render.pyx", line 492, in renpy.display.render.render_screen
  26.   File "render.pyx", line 263, in renpy.display.render.render
  27.   File "renpy/display/layout.py", line 751, in render
  28.     surf = render(child, width, height, cst, cat)
  29.   File "render.pyx", line 170, in renpy.display.render.render
  30.   File "render.pyx", line 263, in renpy.display.render.render
  31.   File "renpy/display/layout.py", line 751, in render
  32.     surf = render(child, width, height, cst, cat)
  33.   File "render.pyx", line 170, in renpy.display.render.render
  34.   File "render.pyx", line 263, in renpy.display.render.render
  35.   File "renpy/display/layout.py", line 751, in render
  36.     surf = render(child, width, height, cst, cat)
  37.   File "render.pyx", line 170, in renpy.display.render.render
  38.   File "render.pyx", line 263, in renpy.display.render.render
  39.   File "renpy/display/transform.py", line 927, in render
  40.     return transform_render(self, width, height, st, at)
  41.   File "accelerator.pyx", line 116, in renpy.display.accelerator.transform_render
  42.   File "render.pyx", line 263, in renpy.display.render.render
  43.   File "renpy/display/image.py", line 501, in render
  44.     return wrap_render(self.target, width, height, st, at)
  45.   File "renpy/display/image.py", line 307, in wrap_render
  46.     rend = render(child, w, h, st, at)
  47.   File "render.pyx", line 170, in renpy.display.render.render
  48.   File "render.pyx", line 263, in renpy.display.render.render
  49.   File "renpy/display/im.py", line 607, in render
  50.     return cache.get(self, render=True)
  51.   File "renpy/display/im.py", line 271, in get
  52.     surf = image.load()
  53.   File "renpy/display/im.py", line 651, in load
  54.     filelike = renpy.loader.load(self.filename)
  55.   File "renpy/loader.py", line 798, in load
  56.     raise IOError("Couldn't find file '%s'." % name)
  57. IOError: Couldn't find file 'sakiei01.png '.

  58. Windows-10-10.0.18362
  59. Ren'Py 7.4.2.1292
  60. DeCoDiary.vol 1 起 demo 1.0
  61. Mon Mar 15 12:36:41 2021
复制代码



打包的部分是这样的:
[RenPy] 纯文本查看 复制代码
build.classify('**~', None)
    build.classify('**.bak', None)
    build.classify('**/.**', None)
    build.classify('**/#**', None)
    build.classify('**/thumbs.db', None)

    build.archive("scripts", "all")
    build.archive("images", "all")

    build.classify("game/**.rpy", "scripts")
    build.classify("game/**.rpyc", "scripts")

    build.classify("game/**.jpg", "images")
    build.classify("game/**.png", "images")
    build.classify('game/**.ogg', 'archive')
    build.classify('game/**.mp3', 'archive')
    build.classify('game/**.mpg', 'archive')
    build.classify('game/**.wav', 'archive')

   
定义图片的部分:

[RenPy] 纯文本查看 复制代码
define s = Character('笫咲影',image="sk")
define z = Character('???')
image logo = "logo1.png"
image logo1 = "logo2.jpg"
image side sk = "ssakiei01.png "
image side sk n = "ssakiei01.png "
image sk n = "sakiei01.png "
image sk = "sakiei01.png "



"rpy/the0.rpyc", line 63部分开始的代码

[RenPy] 纯文本查看 复制代码
show sk
    s n"“我的名字叫笫咲影,在你看来这个名字可能有点奇怪。{w}我的父母也都不姓‘笫’,{w}那他们为什么会给我取这个姓呢?”"






发表于 2021-3-15 16:46:43 | 显示全部楼层
报错日志开头就有了:While loading <'Image' u'sakiei01.png '>

图片文件名后面多了个空格(或者其他不可见字符)……
回复 支持 1 抱歉 0

使用道具 举报

发表于 2021-3-15 13:15:16 | 显示全部楼层
本帖最后由 小猪 于 2021-3-15 14:00 编辑

相关代码贴出来看看吧
回复 支持 抱歉

使用道具 举报

 楼主| 发表于 2021-3-15 14:32:43 | 显示全部楼层
部分代码已贴
回复 支持 抱歉

使用道具 举报

 楼主| 发表于 2021-3-15 17:14:32 | 显示全部楼层
被诅咒的章鱼 发表于 2021-3-15 16:46
报错日志开头就有了:While loading

图片文件名后面多了个空格(或者其他不可见字符)…… ...

问题解决了,就是不知道为什么不打包的时候可以找得到。。。。
回复 支持 抱歉

使用道具 举报

您需要登录后才可以回帖 登录 | 立即注册

本版积分规则

小黑屋|手机版|RenPy中文空间 ( 苏ICP备17067825号|苏公网安备 32092302000068号 )

GMT+8, 2024-11-22 21:41 , Processed in 0.112583 second(s), 26 queries .

Powered by Discuz! X3.5

© 2001-2024 Discuz! Team.

快速回复 返回顶部 返回列表