lento / spam

Spark Project & Asset Manager
GNU General Public License v3.0
7 stars 2 forks source link

*.ext or *.EXT #45

Closed MrPetru closed 11 years ago

MrPetru commented 12 years ago

when a new asset is created ... one of steps in his creation is to define the "asset extension" for example: ground_TXT.jpg as you can see, files that will be allowed to be uploaded are *.jpg the extension jpg or JPG are the same, or not? but SPAM in this case doesn't allow to upload the image ... it is case sensitive

is this a design choice or a bug?

SparkDE commented 12 years ago

Unfortunately many software or external cameras are able to write the extension only with capital letter so the files remain the same. I suggest to set that evidence as a problem.

2012/2/21 MrPetru < reply@reply.github.com

when a new asset is created ... one of steps in his creation is to define the "asset extension" for example: ground_TXT.jpg as you can see, files that will be allowed to be uploaded are *.jpg the extension jpg or JPG are the same, or not? but SPAM in this case doesn't allow to upload the image ... it is case sensitive

is this a design choice or a bug?


Reply to this email directly or view it on GitHub: https://github.com/lento/spam/issues/45

Francesco Paglia Vfx and Production Supervisor

mobile +39 347.82.12.473 e-mail f.paglia.80@gmail.com

lento commented 12 years ago

All of our production infrastructure (filesystems, operating system, the versioning system, SPAM itself) live in case-sensitive world: image.jpg and image.JPG are indeed two different files.

But in our case we are already renaming the published files to their correct name, if I'm not mistaken the thing preventing you to upload image.JPG for asset image.jpg is this simple check: https://github.com/lento/spam/blob/master/spam/controllers/asset/main.py#L370

that was put there to avoid simple mistakes in the publishing form, like clicking on the wrong file while browsing.

Maybe we can create an extra layer of case-insesitiveness (I think I've just invented a new word) at the upload level, by just changing that line to:

            if not uf_ext.lower() == ext.lower():
MrPetru commented 12 years ago

I understood right? this was a design choice ...?

in our case it's enough to know that jpg is equal with JPG and not equal with PNG or png but there can bee other situations like: jpg or jpeg, tif or tiff ... what we can do in this situations... rename files or rename asset? we can't rename an asset and maybe at the moment of his creation we can't know the exact file extension (this can occur). renaming files? this mean we need to have another tool or an artist capable to do bash staff.

I like you solution but it's a partial solution. however partial better that nothing ... I will do it as soon as possible

lento commented 12 years ago

yes, it is a design decision.

There is a very important point of the design that I want to clarify: the primary goal of SPAM is to enforce a tidy workflow for managing files and versions.

You can ask Francesco for a longer explanation, but here is a brief summary: Let's say that you have a group of people collaborating on a project. Our experience tells us that even if you want to organize things cleanly, define a naming convention for the files and try to stick to it, as soon as someone finds the smallest problem in saving a file with the intended name, they will use a slightly different variation of that name, after all it's only temporary! But as we all know, there's nothing more permanent then "temporary". ;) Before you know, the file that was supposed to be saved as image.jpg will be saved as: image_new.jpg image_new-lorenzo2.jpg image_new-final.jpg image_new-final_lorenzo.JPG image_new-dec2011.jpg

and yes, even: image_new-dec2011.tiff :)

SPAM was created specifically to solve this issue! And the solution is based on two basic principles:

These principles can (and should) be applied even without a software, if the naming convention and file versioning workflow are clearly defined in advance. Saying "maybe at the moment of his creation we can't know the exact file extension (this can occur)" is a symptom of a much bigger problem that I would call: "done quickly today, takes forever to fix tomorrow"!

The idea of a strict, controlled, file workflow is not meant to make things more complicated or long, it is meant to keep things manageable. You'll have to trust me on this one, or to try for yourself: today you say "I don't know if it's a jpg or a tiff, let's do something quick and maybe change it later", tomorrow, when the client is waiting for the final delivery and everybody is red-eyed after 30 hours of non-stop work, no one will remember if the final version of that image is the jpg or the tiff.

Today, SPAM forces you to find out exactly if your image will be a jpg or a tiff. Tomorrow, you'll see that it's the only way to manage a complex CG project.

That said, some silly devices and operating systems can't even tell the difference between capital and lowercase (tsk), and it is reasonable (though ugly) to assume that image.jpg and image.JPG are the same format. Since we rename the file to image.jpg anyways, we can still accept the content of image.JPG.

Renaming an asset from image.jpg to image.tiff could mean that some versions of an asset can be used in the following phase of the pipeline, and some others can't. Maybe you think: an image is an image, if I use a jpg as a texture, I can easily switch it for a tiff. But what if another file is referencing the previous file name? And what happens in an animation file if character.blend becomes character.ma? Such a big change is better managed with a new, different asset. (And by the way, some renderers can only use one specific file type for textures, sometime you can't even blindly swap a tif for a jpg).

The fact that the solution is partial is indeed a design decision! The complete solution is that you have to know how your files should be named in advance, with or without SPAM. :)