Welcome Guest! You need to login or register to make posts.

Notification

Icon
Error

Options
Go to last post Go to first unread
vmrocha  
#1 Posted : Tuesday, January 12, 2016 4:27:20 PM(UTC)
vmrocha

Rank: Member

Groups: Member
Joined: 1/10/2016(UTC)
Posts: 15

Thanks: 7 times
I followed along with the blog post "Creation 3D-preview of personalized products" here in this link and it worked just fine. I used the PSD file provided on the post as well.

I tried to use other PSD files but I'm getting the following exception:

Quote:
"File format of a smart frame is corrupted or unsupported."

at Aurigma.GraphicsMill.Templates.PsdFrameExtensions.RenderSmartFrame(Graphics graphics, ReadOnlyCollection`1 warpControlPoints, Matrix projectiveTransform, ReadOnlyCollection`1 vectorMask, Rectangle frameBounds, Stream originalData, Bitmap replacementBitmap, ResizeMode fillMode)

at Aurigma.GraphicsMill.Templates.PsdFrameExtensions.RenderSmartFrame(PsdSmartFrame smartFrame, Graphics graphics, Bitmap replacementBitmap, ResizeMode fillMode)

at Aurigma.GraphicsMill.Templates.PsdFrameExtensions.RenderSmartFrame(PsdSmartFrame smartFrame, Graphics graphics, Pipeline content, ResizeMode fillMode)

at Aurigma.GraphicsMill.Templates.PsdFrameExtensions.ToGraphicsContainer(PsdSmartFrame smartFrame, Pipeline content, ResizeMode resizeMode) (...)

I'm getting the exception on this line of code:

Code:
smartFrame.ToGraphicsContainer(ImageReader.Create(pagePath), ResizeMode.ImageFill);

I got the PSD files from http://www.pixeden.com/

at http://www.pixeden.com/p...iness-card-mock-up-vol-2

and http://www.pixeden.com/p...iness-card-mock-up-vol32

Are they using a different type of Smart Object? Is there any change on the PSD that we can do to make it work with Graphics Mill?

Thanks!

Fedor  
#2 Posted : Thursday, January 14, 2016 9:41:43 AM(UTC)
Fedor

Rank: Advanced Member

Groups: Member, Administration, Moderator
Joined: 7/28/2003(UTC)
Posts: 1,660

Thanks: 5 times
Was thanked: 76 time(s) in 74 post(s)
The Pixeden's mockups are very complex. On the one hand the current version of Graphics Mill doesn't support all features of Adobe Photoshop. On the other hand multiple layers with applied effects and blending mode require a significant amount of time to render.

So we you should merge and rasterize all layers and effects.

UserPostedImage

I have sent you a sample template using PM.

We recommend using simple PSD files to be embedded as Smart Object.

UserPostedImage

Please note you shouldn't use PSB (the Adobe Photoshop's format to store images larger than 30,000 pixels in width or height). The Pixeden's templates contain Smart Object of PSB format, that's why you receive the exception:

"File format of a smart frame is corrupted or unsupported."

I have used the following code to render the mockup:

Code:
using System;
using Aurigma.GraphicsMill;
using Aurigma.GraphicsMill.Codecs;
using Aurigma.GraphicsMill.Codecs.Psd;
using Aurigma.GraphicsMill.Templates;
using Aurigma.GraphicsMill.Transforms;

namespace Forum_13977
{
	class Program
	{
		static void Main(string[] args)
		{
			var psdProcessor = new PsdProcessor();

			psdProcessor.FrameCallback = (processor, frame) =>
			{
				if (frame.Type != FrameType.SmartObject || 
					(frame.Name != "BACK SIDE DESIGN" && frame.Name != "FRONT SIDE DESIGN"))
					return processor.ProcessFrame(frame);

				var smartFrame = (PsdSmartFrame)frame;

				return smartFrame.ToGraphicsContainer(ImageReader.Create("../../../BusinessCard.png"),
					ResizeMode.ImageFill);
			};

			psdProcessor.Render("../../../Business-card-mock-up-Vol2.psd", "../../../result.png");
		}
	}
}

Edited by user Thursday, January 14, 2016 9:55:29 AM(UTC)  | Reason: Not specified

Fedor attached the following image(s):
BusinessCard.png
result.png
Layers.png
FRONT SIDE DESIGN.png
Best regards,

Fedor Skvortsov

Users browsing this topic
Guest
Forum Jump  
You cannot post new topics in this forum.
You cannot reply to topics in this forum.
You cannot delete your posts in this forum.
You cannot edit your posts in this forum.
You cannot create polls in this forum.
You cannot vote in polls in this forum.