Copy link to clipboard
Copied
I just upgraded to CS5 and am having a grand time learning all the interactive features. But today when I began my project, I noticed that when I placed a jpeg from photoshop, it came over at about half it's original size. I created the document to be 800x600 pixels and was importing the background pic (also 800X600). I've changed the original jpeg file from 300dpi (what I originally created it as) to 72 dpi but either way, the image comes across somehow "downscaled".
I've tried to place without a graphic box, I've tried to place with a graphic box, I've also dragged and dropped from photoshop and they all come over the same. What's the dealio?
Heidi
Copy link to clipboard
Copied
universe5554 wrote
Seems a lot of people dont know the real issue here:
create an image with 28 cm width and one with 30 cm width (in photoshop or wherever), and place them in indesign onto an DIN A4 page. voila one is 28cm, the other scales down to 15cm width. Both say scale 100%. My script which should import and place images automatically has no way to determine which has been downscaled and which not.
…
Hi universe5554 ,
what 100% actually means in InDesign depends on the resolution that InDesign can read out from the image file.
If the same pixel data is saved with A. 72 ppi and B. with 144 ppi in PhotoShop then image B will be half in width and half in height than image A after placing. Both images, A and B, have the same scaling value: 100 %.
Unless you are running into a bug with JPEG placing like shown in this thread:
JPG not placing at proper dimensions
FWIW: What script are you referring to?
Regards,
Uwe
Copy link to clipboard
Copied
please read my answer again. it doesn't happen to png's. so it wont depend what dpi i set the image in psd.
as long as i define it to be 30 cm wide, it can be 30cm at 72dpi, or 30cm at 150 dpi, or 30cm at 300dpi. if you want to, you could even set the dpi to 1440.... etcpp
as long as you set the width to 30cm. Thats because DPI is the density of pixels, not the actual format. you need to divide the number of pixels in width by the dpi, in order to get the inch of the width. then you can multiply this number with 2.54 to get the cm of the width of the image. Hence if you define a picture with 30cm length the amount of pixels will be recalculated by Photoshop (that is if "resample image" is checked, of course)
so, again, as long as you set the width to 30cm, then indesign will always place it with exactly 15cm width on a DIN A4 page. If you dont believe me, just reproduce my step to step guide to convince yourself:
create an image at 30cm width in indesign (feel free to choose your favourite dpi , really any you like)
then place this image on a DIN A4 page in indesign. voila it places the image at 15cm width exactly. wrong, buggy and irrational, since the same image saved as png (yes with the same resolution and size, as in "the same image") will be accurately placed at 30cm width.
Did you reproduce this?
my current workaround btw is to resize the whole page at the moment of import to a rediculous large format, and resize it back to Din A4 after initial placement. this is the only way i can think of to get the original 30cm-width the image was saved at.
the script is for a catalog with about 3000 images of any formats and sizes (stamps, letters, letterpieces...) that are imported and layouted by javascript. you can imagine that a lot of envelopes are wider than DIN A4. Hence i get issues when importing such images and try to get their original dimensions. unfortunately the Javascript Api of Indesign wont let you read the metadata of the images.
i coded it for a company that did that manually every 3 month. the designer needed about 14 days to finish the catalog. my script needs an hour.
oh and the jpg placement link you posted is about cc2019. content awareness has nothing to do with this bug. again: it wont occur to pngs (other formats not tested yet) just to jpgs. hence checking a checkbox wont help anyhting. i work in CC 2017 the company uses CS6. even in cs6 this bug was present. there is no content aware fit to turn off in cs6 is there?
Copy link to clipboard
Copied
It's all about not setting the width of a frame if you want to place with 100% by using the dpi that comes with an image.
You just place. Not to a predefined graphic frame, but to the document and then, if you have to, anchor it to an insertion point.
Or, if you dare, use an insertion point from the start to place the image.
If JPEG is placing to a different size than PNG even if dpi is the same, you ran into the bug that I mentioned. I can see this bug as well and confirm what you are seeing if I choose 72 ppi on a 1500 x 1000 px file saved from PhotoShop with Save As.
Instead JPEG use TIFF or PSD. That should yield the same size like your PNGs.
Regards,
Uwe
Copy link to clipboard
Copied
Here my Links panel from my German InDesign CC 2019 version 14.0.2.324:
In this case the JPEG with 1500 x 1000 px with 72 ppi was placed at 50% to an effective ppi of 144.
The same file saved as PSD or TIFF is placed with 72 ppi effective ppi at 100%.
Regards,
Uwe
Copy link to clipboard
Copied
sorry uwe, i now read through the full thread you posted, and yes rob day delivers the codesnippet that rescale the images to their 100% scale right after the placement-event of the image.
It helped that you linked the thread, and i can head on with my client now.
Copy link to clipboard
Copied
There is a bug with jpegs at 3300 pixels that came up recently. See the end of this thread
Copy link to clipboard
Copied
wonderful, uwe already posted this thread, and i found your answer withthe event listener. works like a charme. thanks a lot!
Copy link to clipboard
Copied
Hi universe5554 ,
be careful with event listeners 🙂
Rob's script is either running as long as you do an InDesign session when you double-click the script in your Scripts panel..
Or it is always running until you remove the script from the startup scripts folder.
Hm. One could also place e.g. snippets from idms files or assets from an InDesign library file or assets from a CC Library.
AfterPlace will also react to that. Then the listener could throw an error if there is no image or the image is nested deeper in a structure.
I'd prefer a more subtle approach:
1. Start the script with a double-click from the Scripts panel, alert the user that the script is running.
2. Stop the script with another double-click to the script's name in the Scripts panel, alert the user that the script has stopped.
3. Let's try to be more precise with error handling. Hm. A lot of testing would go into that.
One problem case I did not tackle:
If text is selected or an insertion point in text is selected the script will fail to scale the placed image after placing.
So I suggest the following code where I implemented 1. and 2. ( and a bit of 3. 😞
( function()
{
#targetengine "AfterPlaceScaleTo100%-Rob-and-Uwe"
var eventListenerName = "AfterPlaceScaleTo100%";
if( app.eventListeners.itemByName( eventListenerName ).isValid )
{
app.eventListeners.itemByName( eventListenerName ).remove();
alert( "AfterPlaceScaleTo100%" +"\r"+"removed." );
return;
};
var eventListener = app.eventListeners.add("afterPlace", ourAfterPlace );
eventListener.name = eventListenerName;
alert( "AfterPlaceScaleTo100%" +"\r"+"added." );
function ourAfterPlace( evt )
{
var myEvent = evt;
// E.g. Place text from CC Libraries, do nothing.
if( myEvent.target.constructor.name == "TextFrame" ){ return };
// E.g. Place group asset from IDMS file, asset from InDesign library file, asset from CC Libraries, do nothing.
if( myEvent.target.constructor.name == "Group" ){ return };
// No graphic in frame to place, do nothing:
if( app.activeDocument.selection.length == 0 && myEvent.target.graphics.length == 0 ){ return };
// Two cases.
// 1. Nothing is selected, the graphic will come with a new frame:
if( app.activeDocument.selection.length == 0 ){ var myGraphic = myEvent.target.graphics[0] };
// 2. Something is selected, the graphic will either go into the selected graphic frame or will replace selected text:
else { var myGraphic = myEvent.target };
// CASE 3, UNPREDICTABLE:
if( myGraphic == undefined ){ return };
// Fails silently if graphic is placed in insertionPoint or selected text:
myGraphic.horizontalScale = 100 ;
myGraphic.verticalScale = 100 ;
myGraphic.fit ( FitOptions.FRAME_TO_CONTENT );
};
}() )
Important note to everyone who likes to tinker with that code:
All eventlisteners added to app live outside of the targetengine that someone might declare.
They are not shielded. They could be removed anytime when found by name, by index, id or otherwise by brute force.
Regards,
Uwe
Copy link to clipboard
Copied
thanks, robs snippet runs like a charme. already published the whole catalog (2400 jpegs) without any issues. after the script ran, the document is finished, saved and indesign is closed. so theres no collision with other situations for the listener.
Copy link to clipboard
Copied
I had same problem so found this thread and couldn't find correct answer so here is the correct answer after I played around long enough to figure it out. Go to Image>Image Size in Photoshop and where it says Width and Height if those dimensions are in pixels then switch to inches, and then use those dimensions (inches rather than pixels) to create your InDesign doc. Then your placed files will fit edge to edge perfectly!
Copy link to clipboard
Copied
Wow, ha. A lot of tech talk mumbo jumbo in this thread that has gotten nowhere as far as solutions go. Just makes my head spin. I don't have the answer as to "why" this workaround works, so maybe the tech talk would be beneficial, but whatever. Anyway, a poster above already referenced this as a workaround solution, but this is what worked for me. If I just File>Export in InDesign without creating a box first or anything, and choose a JPG, it is scaling it down. Some random %... 16.6-something %. If I save that exact same JPG out in other formats i.e. PNG, PSD, etc. and take the same steps in INDD i.e. File>Export, it drops those in at 100% scale. Bizarre. So INDD is only scaling down JPGs. Not sure why. But yeah, a workaround solution, which is not perfect, esp. if you're dealing with tons and tons of images, is to convert them to PNGs or some other file format.
Copy link to clipboard
Copied
P.S> @vapordave I didn't mean to reply only to you, but rather to the entire thread. Not trying to insinuate that you were posting a ton of tech talk, because you def. were NOT. Ha. My bad. 😉