inconsistent handling of filenames derived from image names #69221

Closed
opened 2019-08-27 17:14:01 +02:00 by Gaia Clary · 13 comments
Member

System Information
Operating system: windows-10
Graphics card: nvidia

Blender Version
Broken: 2.80
Worked:

Short description of error

special characters in image names are treated differently depending on how an image is saved to file. the issue seems to happen on Windows-10 and on MAC. See also related report: https://developer.blender.org/T69064

Exact steps for others to reproduce the error

  • open the blendfile image_with_special_character.blend
  • from the top row of the UV editor select image -> save
  • Check that the filename in the file selector input field is preset to "template:uvgrid.png"
  • do not change the filename in the file selector box
  • store the file to the file system
  • check on the file system that the file is named "template" and has length 0 (actually this is a stream and not a file)

Now do the very same thing except in step 2:

  • reopen the blend file
  • from the top row of the UV editor select image -> save as ...

proceed as described above ...

You see that blender now tries to replace the ":" in the filename by "_" as soon as you try to save the file.

I guess the correct behavior is to:

  • either allow the ":" in the filename and never modify the filename automatically (let the user handle this)
  • or always take care that no special characters can ever be used for filenames (let blender handle this)

the current mix seems to be not ideal :)

**System Information** Operating system: windows-10 Graphics card: nvidia **Blender Version** Broken: 2.80 Worked: **Short description of error** special characters in image names are treated differently depending on how an image is saved to file. the issue seems to happen on Windows-10 and on MAC. See also related report: https://developer.blender.org/T69064 **Exact steps for others to reproduce the error** - open the blendfile [image_with_special_character.blend](https://archive.blender.org/developer/F7706321/image_with_special_character.blend) - from the top row of the UV editor select image -> save - Check that the filename in the file selector input field is preset to "template:uvgrid.png" - do not change the filename in the file selector box - store the file to the file system - check on the file system that the file is named "template" and has length 0 (actually this is a stream and not a file) Now do the very same thing except in step 2: - reopen the blend file - from the top row of the UV editor select image -> save as ... # proceed as described above ... You see that blender now tries to replace the ":" in the filename by "_" as soon as you try to save the file. I guess the correct behavior is to: - either allow the ":" in the filename and never modify the filename automatically (let the user handle this) - or always take care that no special characters can ever be used for filenames (let blender handle this) the current mix seems to be not ideal :)
Author
Member

Added subscriber: @GaiaClary

Added subscriber: @GaiaClary
Bastien Montagne was assigned by Campbell Barton 2019-08-27 17:58:47 +02:00
Member

Added subscriber: @LazyDodo

Added subscriber: @LazyDodo
Member

Just for reference on why windows is just not flat out rejecting filenames with : in it

NTFS supports a thing called alternate data streams

the following is completely legal

f:\test>echo hi > hi.txt
f:\test>echo hello world > hi.txt:hello
f:\test>dir hi.txt
 Volume in drive F is BlahBlah
 Volume Serial Number is 1234-1234

 Directory of f:\test

2019-08-27  10:08 AM                 5 hi.txt

f:\test>more < hi.txt
hi

f:\test>more < h1.txt:hello:$DATA
hello world

however not many apps can deal with this construct and if we just not support it and forbid the : character in a filename, I doubt anyone would miss it.

Just for reference on why windows is just not flat out rejecting filenames with `:` in it NTFS supports a thing called alternate data streams the following is completely legal ``` f:\test>echo hi > hi.txt f:\test>echo hello world > hi.txt:hello f:\test>dir hi.txt Volume in drive F is BlahBlah Volume Serial Number is 1234-1234 Directory of f:\test 2019-08-27 10:08 AM 5 hi.txt f:\test>more < hi.txt hi f:\test>more < h1.txt:hello:$DATA hello world ``` however not many apps can deal with this construct and if we just not support it and forbid the `:` character in a filename, I doubt anyone would miss it.

Added subscriber: @StephenSwaney

Added subscriber: @StephenSwaney

or always take care that no special characters can ever be used for filenames (let blender handle this)

That seems the simplest approach.
A good principle is "Be liberal in what you accept and conservative in what you output", which applied to this case means sanitizing the filenames by replacing weird characters with '_' or such.

> or always take care that no special characters can ever be used for filenames (let blender handle this) That seems the simplest approach. A good principle is "Be liberal in what you accept and conservative in what you output", which applied to this case means sanitizing the filenames by replacing weird characters with '_' or such.

No special chars are supposed to be allowed in our filnames... that's just a bug of a missing check somewhere in the code

No special chars are supposed to be allowed in our filnames... that's just a bug of a missing check somewhere in the code

This issue was referenced by 01bd22929f

This issue was referenced by 01bd22929fdb2c7ec0f564faee46c0ad84d11687

Changed status from 'Open' to: 'Resolved'

Changed status from 'Open' to: 'Resolved'

Added subscriber: @Kent-Davis

Added subscriber: @Kent-Davis

Did not resolve because of "/" and ":" for Macintosh.
https://developer.blender.org/T69064

Did not resolve because of "/" and ":" for Macintosh. https://developer.blender.org/T69064

@mont29 did not resolve yet. Need to fix automatic " : " change to " _ " itself because of Macintosh cause appear " / " on Finder from " : " on Blender 2.81 beta.

@mont29 did not resolve yet. Need to fix automatic " : " change to " _ " itself because of Macintosh cause appear " / " on Finder from " : " on Blender 2.81 beta.

@Kent-Davis afaik issue reported here has been fixed. If you think it is not, please explain properly your problem, your sentence above make no sense to me. Or open a new report with all expected info, and a precise and complete description of the issue.

@Kent-Davis afaik issue reported here has been fixed. If you think it is not, please explain properly your problem, your sentence above make no sense to me. Or open a new report with all expected info, and a *precise and complete* description of the issue.
This one https://developer.blender.org/T69064 @mont29
Sign in to join this conversation.
No Label
Interest
Alembic
Interest
Animation & Rigging
Interest
Asset Browser
Interest
Asset Browser Project Overview
Interest
Audio
Interest
Automated Testing
Interest
Blender Asset Bundle
Interest
BlendFile
Interest
Collada
Interest
Compatibility
Interest
Compositing
Interest
Core
Interest
Cycles
Interest
Dependency Graph
Interest
Development Management
Interest
EEVEE
Interest
EEVEE & Viewport
Interest
Freestyle
Interest
Geometry Nodes
Interest
Grease Pencil
Interest
ID Management
Interest
Images & Movies
Interest
Import Export
Interest
Line Art
Interest
Masking
Interest
Metal
Interest
Modeling
Interest
Modifiers
Interest
Motion Tracking
Interest
Nodes & Physics
Interest
OpenGL
Interest
Overlay
Interest
Overrides
Interest
Performance
Interest
Physics
Interest
Pipeline, Assets & IO
Interest
Platforms, Builds & Tests
Interest
Python API
Interest
Render & Cycles
Interest
Render Pipeline
Interest
Sculpt, Paint & Texture
Interest
Text Editor
Interest
Translations
Interest
Triaging
Interest
Undo
Interest
USD
Interest
User Interface
Interest
UV Editing
Interest
VFX & Video
Interest
Video Sequencer
Interest
Virtual Reality
Interest
Vulkan
Interest
Wayland
Interest
Workbench
Interest: X11
Legacy
Blender 2.8 Project
Legacy
Milestone 1: Basic, Local Asset Browser
Legacy
OpenGL Error
Meta
Good First Issue
Meta
Papercut
Meta
Retrospective
Meta
Security
Module
Animation & Rigging
Module
Core
Module
Development Management
Module
EEVEE & Viewport
Module
Grease Pencil
Module
Modeling
Module
Nodes & Physics
Module
Pipeline, Assets & IO
Module
Platforms, Builds & Tests
Module
Python API
Module
Render & Cycles
Module
Sculpt, Paint & Texture
Module
Triaging
Module
User Interface
Module
VFX & Video
Platform
FreeBSD
Platform
Linux
Platform
macOS
Platform
Windows
Priority
High
Priority
Low
Priority
Normal
Priority
Unbreak Now!
Status
Archived
Status
Confirmed
Status
Duplicate
Status
Needs Info from Developers
Status
Needs Information from User
Status
Needs Triage
Status
Resolved
Type
Bug
Type
Design
Type
Known Issue
Type
Patch
Type
Report
Type
To Do
No Milestone
No project
No Assignees
6 Participants
Notifications
Due Date
The due date is invalid or out of range. Please use the format 'yyyy-mm-dd'.

No due date set.

Dependencies

No dependencies set.

Reference: blender/blender#69221
No description provided.