Page MenuHome

The icon of the PSD file is not displayed. /* need to confirm in non OSX */
Closed, ResolvedPublic

Description

--- Operating System, Graphics card ---
Windows XP/SP3 32bits
Nvidia GeForce 9500GT 512MB

--- Blender version with error, and version that worked ---
version 2.69 r60652 Daily Build (blender-2.69-r60652-win32.zip)

--- Short description of error ---
The icon of the PSD file is not displayed.

--- Steps for others to reproduce the error (preferably based on attached .blend file) ---
The icon of the PSD file is not displayed with a file opening screen.

Event Timeline

Confirmed the PSD support is not working in SCons build on Ubuntu 13.10, while it's working correctly in CMake build. The SCons build seems still incomplete.

Assigning to Dalai.

scons is not building here (OSX) at the moment, and is not the original reported issue.
As for the report: as you can see from the attached image the icon is shown here. If it doesn't show can you please send a screenshot of the problem?

Attached a patch (fix_psd_scons.patch). Please test it.
Note that the PSD support defaults to OFF, so you have to enable it explicitly as follows:

Windows:

python scons\scons.py WITH_BF_PSD=True

Mac:

python scons/scons.py WITH_BF_PSD=True

Linux:

python scons/scons.py WITH_BF_OIIO=True WITH_BF_PSD=True

Because I came to work normally, I attach an image and report it.

Can you attach a PSD file that doesnt work? Like the fish.psd

scons patch adapted and committed.
As for your file I suspect it was not saved with maximum compatibility. I can't tell without looking at them.

scons building was fixed on rev. 60690. closing the report now.
If you still have problems make sure the PSD was saved with compatibility option. And if the problem still persist please attach the problematic file and I can reopen the report

I seemed to do the report that let you misunderstand it.
I do not use attached Patch.

I just watched attached Patch, but this is the contents itself which I reported.

Both CMake and Scons builds were still broken, so I fixed them in r60692.

Perfection cat, could you please try the latest svn? (You don't need additional build option like "WITH_BF_PSD=True" anymore.)

I tried it in the latest edition that you revised.
It can read the file which I output in Psd form in Blender once.
And the icon is shown a thumbnail.
However, it cannot read original psd file as ever.
And the original thumbnail indication is not possible.

The image which I attached is an opened image in Gimp2.
I use the image of a sample enclosed by PhotoShop.
I read an original image in Blender and saved it in psd form without processing anything.
There is considerably a difference in luminosity to two images, but what is this cause?

perfection cat *Please Attach a Sample .PSD file* where I can see the problem.
The difference you see is most likely due to color management issues

from your comment on the mailing list the bug was fixed. I'm closing it now, thanks for the report.
Next time please prioritize using the tracker over the mailing list. The noise ratio in the list is already too high.

I think this bug report to open again.
Even if the icon of the psd file that the contents are jpeg is displayed, it does not have a meaning.
The icon of the psd file is not displayed definitely now either.

I attach psd file.

you need to save the file with max-compatibility
see psd.png attached

I do not know whether I may attach a sample file enclosed by Photoshop.
Do you support only max-compatibility?
There is not so a lot a person having Photoshop in individuals.
And it is not announced when it supports only max-compatibility.
You tell me to attach a file, but this problem does not occur with a specific file.
If you test it with the sample file included in it if you have Photoshop, the result appears.

I attach blender-2.69-r60739-win32.JPG.
I deleted all the thumbnail that Blender made from a PC and ran it.
I use Blender of daily build distributed in an official site.
Fish.psd, NewFish.psd and PerfectionCat.psd are psd files of max-compatibility.
nPerfectionCat.psd, GimpFish.psd are the psd files which they output in Gimp.

attached (fish.png) how I see fish.psd in OSX.
re-opening so someone can report how it looks in linux or again in windows.

does the file open? or not at all. (in other words, is this a thumbnail only problem or blender can't open it either).

The max-compatibility is mentioned here: http://wiki.blender.org/index.php/Dev:Ref/Release_Notes/2.70#PSD_files
There is not much we can do for the thumbnails (overkill to report an error in their case), but I can look at adding a report error when Blender fails to open the PSD file
(right now you get a message on console only - IMB_ibImageFromFile: unknown fileformat )

I can never open psd with the file which you revised since I reported the problem of the psd file first.
In addition, I can never display the icon of the psd file.
There is the thing that the icon of the psd file is displayed in the image which I attached.
When one uses Blender which linked a library of OpenImageIO which I revised.
Extension is psd one more, but is the file that the contents were stored in jpeg form.
Because it was not made by a correction of svn of a while ago, the latter does not exist anymore.

I'm sorry.
I did not read a message of r60621 till the last.
It was written clearly that it was necessary to be max-compatibility.
I downloaded a sample file of psd distributed in github and tried it, but the result was the same.

Because there was a part expressing giving misunderstanding, I correct it.
I remodel OpenImageIO of version 1.1.11 and use it.
I do not make modifications ordered in r60621.

fish.psd thumbnail generates OK here, 64bit Linux.

Probably I think that it depends on the compiler.
It is a cause that fail by an initialization function called by a constructer of class ImageInput.
It calls the close function of the stream to close a stream by an initialization function.
However, naturally the stream does not open because it is the generation of the constructer.
close is not to handle it by an initialization function

I had nothing to do with this problem, but this sometimes sometimes misread the version of the psd file.
The position of the stream seemed to slip off when I checked it.
It came to recognize a version to add the handling of to correct at the time of a start with a position in the lead read_header function definitely.

Fish.psd is thumbnailed here, but nPerfectionCat.psd is not.
Also tested them with the oiio's image vewer (iv). The iv crashes when loading nPerfectionCat.psd.

r60795
Ubuntu 13.10 amd64
OpenImageIO 1.2.2

nPerfectionCat.psd is not max-compatibility.

An icon is displayed like the image which I attached when I use Blender which changed the OiiO library.
I attached My OiiO Lib.JPG.

GimpFish.psd and nPerfectionCat.psd are not max-compatibility.

@Thomas, can you test if Fish.psd produces a correct thumbnail (and open) in Windows?

@perfectioncat it may be that windows is using a different version of OIIO than osx and linux

They seem to use 1.2.2 so that irie writes it.
We use 1.1.11.
I already checked 1.2.2, but the point that I pointed out thinks that the problem is not settled because it was the same.

I was scolded to you, but I reported many times in mailing list.
An icon is displayed in the library which I remodeled definitely.
And I can open the file.
I have only environment of windows.

I thought that you knew it because it was ordered as a construction method of the oiio library of windows.
I downgrade it in 1.1.11 and it is built by it after applying patch.

I checked with Fish.psd on SVN 60789 (Windows 7 x64):

* Image Editor -> Open -> Thumbnail View: No thumbnail is generated for Fish.psd
Also after opening nothing. I get "IMB_ibImageFromFile: unknown fileformat (C:\Users\Thomas\Desktop\Fish.psd)" in console.

I compile a release build config, so OIIO is enabled. Any special flag to set?

@Thomas I think that you should run daily build even if you do not build.

My own builds and buildbot should be the same, I do Windows release builds.

Yes, buildbot Win x64 behaves the same.

@Thomas, are you building with scons or cmake? I tested only with CMake

@PerfectCat I remember similar issues with OpenEXR on Windows. We will eventually use OIIO 1.3 with Blender, so we are not updating the libraries in the meantime.
It's important to know beforehand if the libraries will work.

Now, I didn't mean to 'scold' you in the list, but you need to understand that the mailing list is not the place to discuss bugs, as I repeatedly mentioned. Apart from that it's been really difficult to understand what you are trying to say. I understand that English is not your first English (nor is fine), so there is an extra effort required by all parts.

In general if you are proposing a code change it's easier to attach (or point to a link on pasteall.org) with a patch.
If you are referring to unexpected behaviour, an image can speak by itself. And a sample file is a most anytime.

edit: "I understand that English is not your first language (nor is mine), so there is an extra effort required by all parts."

So, it works in OSX with Scons and CMake, and on Windows it works with CMake only...

It was understood that you determined not to support it when it was built in SCONS.
Then I want you to consider it to exclude the function in SCONS.
It becomes with a build switch of OiiO and cannot remove it individually now.
I can do it personally, but compatibility with svn lowers.
If you do not exclude it, the failed thumbnail is recorded.
There are not many users understanding a method to update failed thumbnail.
Because I establish the build switch that I control the generation of the thumbnail personally, I do not come under influence.

I tried VS2012 + SCons on Win64, and confirmed the PSD support works properly.
However I couldn't try VC++ Express 2008 because Microsoft seems not to distribute it anymore.

@Shinsuke Irie: Can you try the builds from the build-bot? (builder.blender.org). I believe they are also using scons.

Actually did you build a 64 build or a 32? (I know your windows is 64, but the build doesn't need to be necessarily)
Same for @Thomas, the one that failed was 32 or 64?

My CMake build in Windows was VS2012, Debug I don't remember which bit. (my windows machine runs under virtual machine, so it's a clumsy test box)

Tested the buildbot r60807 64bit.
Icon preview is OK, but loading PSD file fails. I got an error "IMB_ibImageFromFile: unknown fileformat".

The own build is actually 64bit, using vcvarsall.bat with an argument "x86_amd64".

The thumbnails are cached (~/.thumbnails/fail/blender and ~/.thumbnail/normal). If you remove the files from those folders they will probably fail as well in the buildbot you tested.
Thomas just reported that he built with msvc9, scons 64 bit

We can wait for a few days until the buildbot experimental vs2012 machine builds an updated blender. That should help to decide if the error is indeed msvc2008 vs 2012.
(we are looking for a build after your scons fixes on 60698)

Ah sorry, the icon preview is indeed not working with the buildbot build...

There is a version mismatch going on.
http://lists.blender.org/pipermail/bf-committers/2013-October/041956.html

I committed debug prints for error in the PSD loader. r60841.
We can now obtain more verbose error message in console.

Tested the latest buildbot builds r60854. VS2012 build also is available.

2012 (vc11):

Works as we expect. Everything is OK.

2008 (vc9):

Still doesn't work. I got the following error messages in console:

imb_load_photoshop: ImageInput::create() failed:
OpenImageIO could not open "C:\Users\irie\Downloads\Fish.psd" as psd: [Header] invalid signature
[Header] invalid signature
imb_load_photoshop: ImageInput::create() failed:
OpenImageIO could not open "C:\Users\irie\Downloads\Fish.psd" as psd: [Header] invalid signature
[Header] invalid signature
IMB_ibImageFromFile: unknown fileformat (C:\Users\irie\Downloads\Fish.psd)

File signature recognition in the OIIO library seems to go wrong. I think there is nothing to do further in Blender side.

> I think there is nothing to do further in Blender side.
It would help to know if the version we are using with vc11 (1.2.2) would work for the vc9.
Or even the other way around, if the version we are using with vc9 (1.1.11) works with the vc11.

This would reveal if the problem is the compiler or the library version.
It's a lot of work to test that though, so I wouldn't mind if we get back to that only after the new library is actually required.

I show the point that I changed if you intend to change a library.

void
PSDInput::init ()
{
m_filename.clear ();
// m_file.close ();
m_subimage = -1;
m_subimage_count = 0;
m_specs.clear ();
m_WantRaw = false;
m_layers.clear ();
m_image_data.channel_info.clear ();
m_image_data.transparency = false;
m_channels.clear ();
m_alpha_names.clear ();
m_channel_buffers.clear ();
m_rle_buffer.clear ();
m_transparency_index = -1;
m_keep_unassociated_alpha = false;
m_background_color[0] = 1.0;
m_background_color[1] = 1.0;
m_background_color[2] = 1.0;
m_background_color[3] = 1.0;
}


bool
PSDInput::close ()
{
m_file.close ();
init();
return true;
}

bool
PSDInput::read_header ()
{
m_file.seekg( 0, std::ios::beg );
m_file.read (m_header.signature, 4);
read_bige<uint16_t> (m_header.version);
m_file.seekg(6, std::ios::cur);
read_bige<uint16_t> (m_header.channel_count);
read_bige<uint32_t> (m_header.height);
read_bige<uint32_t> (m_header.width);
read_bige<uint16_t> (m_header.depth);
read_bige<uint16_t> (m_header.color_mode);
return check_io ();
}

I changed read_header for the following reasons.

It cannot process it by the reading of the header after the case that the psd file which does not have Maximum-compatible was included in definitely.

I tried it in CMake+vs2008 of Windows, but the thumbnail is not displayed.

@perfection_cat:
1) Forget about thumbnail not displaying. The real issue is whether or not the image loads fine (once that's working, then we all clean our thumbnail caches and see if it's working, this way the tests are more reliable).

2) As suggested some time ago, please share a patch of the changes you did to OIIO. We are getting lost in translation here, but code is 'universal language' ;)

3) Does it work with your patch?

4) Does it work with 'master' of openimageio?
Thanks

I thought what said to work in exe which you built in CMake in a question.
Therefore I built in CMake+vs2008.
And it was proved not to work when I tried it with the library of the master.
I confirmed that error message was output by a console.
I have already known that a thumbnail is performed cash of.

I attach the file which applied a change point to an original file of 1.1.11.

Because it is not translated as I intended by machine translation, I rewrite it.

I show the reason that changed the read_header function.
When the psd file which had low compatibility was mixed, it might not acquire signature of the file with maximum compatibility definitely.
I changed read_header function to improve the phenomenon.

Because I revised a file collected in master of OpenimageIO, I attach it.
It functions in my environment.

https://github.com/OpenImageIO/oiio

Thomas Dinges (dingto) changed the task status from Unknown Status to Resolved.Dec 6 2013, 5:37 PM

The issue has been fixed on Windows, please update the libraries from SVN or use a new build.

(x32 libs are being commited atm, should be up in a few minutes).