You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@corinthia.apache.org by Artur Teixeira <ar...@top-docs.co> on 2015/04/14 16:44:34 UTC

JPEG in Linux -ERROR

Good Afternoon,
I'd greatly appreciate if you can help me with an issue im having with the
dfconvert.

When i execute the OS X version "dfconvert create to.docx from.html" there
is no problem.
BUT if i execute the same code with the same files in LINUX the .jpeg gives
out this information:

> Could not get aspect ratio of image: Unsupported image format

Is this normal? The linux version isn't prepared for this yet? Is there a
simple solution out there?
I couldn't find a good answer for this online.

P.S. I don't know if it helps but, the conversion of the .docx with jpeg
files to .html (and "images" folder) has no problem either in LINUX or OS
X, with or without JPEG.

Best regards,
-- 
Artur Teixeira
Web & iOS Developer @ TopDocs

Re: JPEG in Linux -ERROR

Posted by Peter Kelly <pm...@apache.org>.
> On 14 Apr 2015, at 9:44 pm, Artur Teixeira <ar...@top-docs.co> wrote:
> 
> Good Afternoon,
> I'd greatly appreciate if you can help me with an issue im having with the
> dfconvert.
> 
> When i execute the OS X version "dfconvert create to.docx from.html" there
> is no problem.
> BUT if i execute the same code with the same files in LINUX the .jpeg gives
> out this information:
> 
>> Could not get aspect ratio of image: Unsupported image format
> 
> Is this normal? The linux version isn't prepared for this yet? Is there a
> simple solution out there?
> I couldn't find a good answer for this online.

It should work - this sounds like a bug. Would you be able to email me a copy of the document? It might be something unique/different about that document in comparison to the others I’ve tested with.

The way we get image dimensions differs between platforms. On OS X and iOS we use Apple’s ImageIO framework, which is bundled with the OS. On Linux and Windows we use SDL_image. There is a function called DFGetImageDimensions which has different implementations for each platform; this would be the place to look if you want to have a go at debugging it yourself (see DocFormats/platform/src/Linux.c).

> P.S. I don't know if it helps but, the conversion of the .docx with jpeg
> files to .html (and "images" folder) has no problem either in LINUX or OS
> X, with or without JPEG.

Yeah we don’t actually need to get the image dimensions/aspect ratio when going the other way - docx stores both the width and height of the image within the XML content of the document itself, so we can derive the aspect ratio from that automatically. It’s only in the case of HTML where image sizes can be expressed by width only (our editing code sets width=“X%”, that is a percentage of page width, and leaves height unspecified).

—
Dr Peter M. Kelly
pmkelly@apache.org

PGP key: http://www.kellypmk.net/pgp-key <http://www.kellypmk.net/pgp-key>
(fingerprint 5435 6718 59F0 DD1F BFA0 5E46 2523 BAA1 44AE 2966)


Re: JPEG in Linux -ERROR

Posted by Gabriela Gibson <ga...@gmail.com>.
I was probably talking rubbish, since I think my Ubuntu has kind of rotted.

There's a number of things going wrong with it, but for now, I daren't fix
it, because if it goes wrong if I upgrade/reinstall Ubuntu, I am really
going to be in trouble.

As long as git, gcc and emacs works, I'm going to survive ;-D

Lesson: when you move country, do not stash your server in the furniture
container.

G, the 'laptop lada technician'

On Sat, Apr 18, 2015 at 5:46 PM, jan i <ja...@apache.org> wrote:

> Forwarding replies as it seems artur is not subscribed to dev@
>
> to us: when somebody new to the list, it is good to add the mail addr to
> the reply (I know I forgot it).
>
> rgds
> jan I.
>
>
> On 15 April 2015 at 18:47, Gabriela Gibson <ga...@gmail.com>
> wrote:
>
> > This may not be related, but I just borrowed a couple of owl piccies from
> > Wikipedia, which saved as '.jpg' files and it was not a success. So it
> > maybe that Corinthia is innocent and something else is afoot.
> >
> > GIMP is refusing to open them and complains thus:
> >
> > [[
> > JPEG image Message
> >
> > Not a JPEG file: starts with 0x3c 0x21
> >
> > Opening '/home/g/cor5/incubator-corinthia/sample/documents/owl_chick.jpg'
> > failed:
> >
> > JPEG image plug-In could not open image
> > ]]
> >
> > Place where I got it: https://en.wikipedia.org/wiki/Owl
> >
> > Files I tried:
> > https://en.wikipedia.org/wiki/File:Athene_cuniculariaa.jpg
> > https://en.wikipedia.org/wiki/File:Short-eared_owl_chick.jpg
> >
> > As a side note, I'm assuming that it's OK to borrow wiki images for
> Apache
> > projects?
> >
> > G
> >
> >
> > On Tue, Apr 14, 2015 at 7:29 PM, jan i <ja...@apache.org> wrote:
> >
> > > On Tuesday, April 14, 2015, Artur Teixeira <ar...@top-docs.co> wrote:
> > >
> > > > Good Afternoon,
> > > > I'd greatly appreciate if you can help me with an issue im having
> with
> > > the
> > > > dfconvert.
> > > >
> > > > When i execute the OS X version "dfconvert create to.docx from.html"
> > > there
> > > > is no problem.
> > > > BUT if i execute the same code with the same files in LINUX the .jpeg
> > > gives
> > > > out this information:
> > > >
> > > > > Could not get aspect ratio of image: Unsupported image format
> > > >
> > > > Is this normal? The linux version isn't prepared for this yet? Is
> > there a
> > > > simple solution out there?
> > > > I couldn't find a good answer for this online.
> > >
> > > As far as I know it should work, I do not have my dev. platform right
> > here,
> > > but when you
> > > linked you need to give extra libraries, one being iconv that is
> > > responsible for the conversion.
> > >
> > > if nobody beats me to it, I will take a look in the source tomorrow.
> > >
> > > rgds
> > > jan i
> > >
> > > >
> > > > P.S. I don't know if it helps but, the conversion of the .docx with
> > jpeg
> > > > files to .html (and "images" folder) has no problem either in LINUX
> or
> > OS
> > > > X, with or without JPEG.
> > > >
> > > > Best regards,
> > > > --
> > > > Artur Teixeira
> > > > Web & iOS Developer @ TopDocs
> > > >
> > >
> > >
> > > --
> > > Sent from My iPad, sorry for any misspellings.
> > >
> >
> >
> >
> > --
> > Visit my Coding Diary: http://gabriela-gibson.blogspot.com/
> >
>



-- 
Visit my Coding Diary: http://gabriela-gibson.blogspot.com/

Re: JPEG in Linux -ERROR

Posted by jan i <ja...@apache.org>.
Forwarding replies as it seems artur is not subscribed to dev@

to us: when somebody new to the list, it is good to add the mail addr to
the reply (I know I forgot it).

rgds
jan I.


On 15 April 2015 at 18:47, Gabriela Gibson <ga...@gmail.com>
wrote:

> This may not be related, but I just borrowed a couple of owl piccies from
> Wikipedia, which saved as '.jpg' files and it was not a success. So it
> maybe that Corinthia is innocent and something else is afoot.
>
> GIMP is refusing to open them and complains thus:
>
> [[
> JPEG image Message
>
> Not a JPEG file: starts with 0x3c 0x21
>
> Opening '/home/g/cor5/incubator-corinthia/sample/documents/owl_chick.jpg'
> failed:
>
> JPEG image plug-In could not open image
> ]]
>
> Place where I got it: https://en.wikipedia.org/wiki/Owl
>
> Files I tried:
> https://en.wikipedia.org/wiki/File:Athene_cuniculariaa.jpg
> https://en.wikipedia.org/wiki/File:Short-eared_owl_chick.jpg
>
> As a side note, I'm assuming that it's OK to borrow wiki images for Apache
> projects?
>
> G
>
>
> On Tue, Apr 14, 2015 at 7:29 PM, jan i <ja...@apache.org> wrote:
>
> > On Tuesday, April 14, 2015, Artur Teixeira <ar...@top-docs.co> wrote:
> >
> > > Good Afternoon,
> > > I'd greatly appreciate if you can help me with an issue im having with
> > the
> > > dfconvert.
> > >
> > > When i execute the OS X version "dfconvert create to.docx from.html"
> > there
> > > is no problem.
> > > BUT if i execute the same code with the same files in LINUX the .jpeg
> > gives
> > > out this information:
> > >
> > > > Could not get aspect ratio of image: Unsupported image format
> > >
> > > Is this normal? The linux version isn't prepared for this yet? Is
> there a
> > > simple solution out there?
> > > I couldn't find a good answer for this online.
> >
> > As far as I know it should work, I do not have my dev. platform right
> here,
> > but when you
> > linked you need to give extra libraries, one being iconv that is
> > responsible for the conversion.
> >
> > if nobody beats me to it, I will take a look in the source tomorrow.
> >
> > rgds
> > jan i
> >
> > >
> > > P.S. I don't know if it helps but, the conversion of the .docx with
> jpeg
> > > files to .html (and "images" folder) has no problem either in LINUX or
> OS
> > > X, with or without JPEG.
> > >
> > > Best regards,
> > > --
> > > Artur Teixeira
> > > Web & iOS Developer @ TopDocs
> > >
> >
> >
> > --
> > Sent from My iPad, sorry for any misspellings.
> >
>
>
>
> --
> Visit my Coding Diary: http://gabriela-gibson.blogspot.com/
>

Re: JPEG in Linux -ERROR

Posted by Gabriela Gibson <ga...@gmail.com>.
This may not be related, but I just borrowed a couple of owl piccies from
Wikipedia, which saved as '.jpg' files and it was not a success. So it
maybe that Corinthia is innocent and something else is afoot.

GIMP is refusing to open them and complains thus:

[[
JPEG image Message

Not a JPEG file: starts with 0x3c 0x21

Opening '/home/g/cor5/incubator-corinthia/sample/documents/owl_chick.jpg'
failed:

JPEG image plug-In could not open image
]]

Place where I got it: https://en.wikipedia.org/wiki/Owl

Files I tried:
https://en.wikipedia.org/wiki/File:Athene_cuniculariaa.jpg
https://en.wikipedia.org/wiki/File:Short-eared_owl_chick.jpg

As a side note, I'm assuming that it's OK to borrow wiki images for Apache
projects?

G


On Tue, Apr 14, 2015 at 7:29 PM, jan i <ja...@apache.org> wrote:

> On Tuesday, April 14, 2015, Artur Teixeira <ar...@top-docs.co> wrote:
>
> > Good Afternoon,
> > I'd greatly appreciate if you can help me with an issue im having with
> the
> > dfconvert.
> >
> > When i execute the OS X version "dfconvert create to.docx from.html"
> there
> > is no problem.
> > BUT if i execute the same code with the same files in LINUX the .jpeg
> gives
> > out this information:
> >
> > > Could not get aspect ratio of image: Unsupported image format
> >
> > Is this normal? The linux version isn't prepared for this yet? Is there a
> > simple solution out there?
> > I couldn't find a good answer for this online.
>
> As far as I know it should work, I do not have my dev. platform right here,
> but when you
> linked you need to give extra libraries, one being iconv that is
> responsible for the conversion.
>
> if nobody beats me to it, I will take a look in the source tomorrow.
>
> rgds
> jan i
>
> >
> > P.S. I don't know if it helps but, the conversion of the .docx with jpeg
> > files to .html (and "images" folder) has no problem either in LINUX or OS
> > X, with or without JPEG.
> >
> > Best regards,
> > --
> > Artur Teixeira
> > Web & iOS Developer @ TopDocs
> >
>
>
> --
> Sent from My iPad, sorry for any misspellings.
>



-- 
Visit my Coding Diary: http://gabriela-gibson.blogspot.com/

Re: JPEG in Linux -ERROR

Posted by jan i <ja...@apache.org>.
On Tuesday, April 14, 2015, Artur Teixeira <ar...@top-docs.co> wrote:

> Good Afternoon,
> I'd greatly appreciate if you can help me with an issue im having with the
> dfconvert.
>
> When i execute the OS X version "dfconvert create to.docx from.html" there
> is no problem.
> BUT if i execute the same code with the same files in LINUX the .jpeg gives
> out this information:
>
> > Could not get aspect ratio of image: Unsupported image format
>
> Is this normal? The linux version isn't prepared for this yet? Is there a
> simple solution out there?
> I couldn't find a good answer for this online.

As far as I know it should work, I do not have my dev. platform right here,
but when you
linked you need to give extra libraries, one being iconv that is
responsible for the conversion.

if nobody beats me to it, I will take a look in the source tomorrow.

rgds
jan i

>
> P.S. I don't know if it helps but, the conversion of the .docx with jpeg
> files to .html (and "images" folder) has no problem either in LINUX or OS
> X, with or without JPEG.
>
> Best regards,
> --
> Artur Teixeira
> Web & iOS Developer @ TopDocs
>


-- 
Sent from My iPad, sorry for any misspellings.